0/1 knapsack problem | Dynamic Programming Application

0/1 knapsack problem

  1.  An object is either included or not included in the knapsack. i.e., xi = 0/1, 1 ≤ i≤ n Thus the problem can be stated as:
    0/1 knapsack problem                                                                 And xi = 0 or 1, I <= i <= n
  2. Fractional knapsack problem exhibits greedy choice property. Greedy algorithm exists.
  3. 0/1 knapsack problem does not exhibits greedy choice property. No greedy algorithm exists.
  4. It exhibits optimal substructure property. Only dynamic programming algorithm exists.
  5. Let Si represent the possible states resulting from the decision sequences
    Si = { (P,W) }
    Where P – total profit earned

               W – total weight of objects included
    Si 1 = { (P,W) / (P-pi, W-wi) E Si }
    Si+1 = Si + Si1

0/1 knapsack problem

 

 

Leave a Reply