Essay How to Manage Our Budget Efficiently

3051 Words13 Pages
1. INTRODUCTION

The project illustrated here is related to our day to day life where we have to purchase things and we have constraints with us i.e. with in given constraints of money we have to manage our budget efficiently.

The project includes of a buyer , who has to invest his money for purchasing items. Every item is associated with a price and also has a margin. The margin indicates the profit which the buyer gets when he sells that item.

This is quite similar to knapsack problem where we have weight of knapsack and items with weights and their associated profit value. By relating this application with knapsack, here weight of bag is considered as total money that the buyer has and the items weights related to item price and
…show more content…
The reason behind this is that there are many real domains in which it appears. Although its NP-completeness, many algorithms have been proposed such as greedy and dynamic that exhibit impressive behavior in the average case.

The 0/1 knapsack problem can be solved with the help of dynamic programming.

Let us consider w1 ,w2 ,w3,w4,…….wn , w are positive integers, w is weight of knapsack. Let m[ i, w] to be the maximum value .
We can define m[ i, w] recursively as follows: m[ i, w] = m[i-1 , w] if wi > w (if the current weight wi is greater then w) m[ i, w] = max ( m[i-1 , w] , m[i-1,w-wi ]+ vi ) wi ≤w
Dynamic programming considers all the possible solution to solve the problem so it is a NP problem. So we can use Genetic Algorithms to solve 0/1 knapsack problem. WE can solve 0/1 knapsack problem with genetic algorithm and can get optimal solution. As 0/1 knapsack problem is a NP problem but when we solve this problem with the help of genetic algorithm it will no longer to be a NP problem. With the help of Genetic Algorithm we will get optimal solution. So Genetic Algorithm can be thought as best approach for finding solutions to the problem for which there exists no feasible solution.

2.2 NP PROBLEMS AND THE 0/1 KNAPSACK

NP (non-deterministic polynomial) problems are such problems for which there are no possible algorithms that would guarantee to run the problem in a polynomial time.
Get Access