next up previous
Next: Dynamic Programming for 0-1 Up: CSE 2320: Algorithms and Previous: Dynamic Programming for Activity

0-1 Knapsack Problem

Example:

Item Value Weight Val/Weight
1 60 10 6
2 100 20 5
3 120 30 4

W = 50

The greedy solution would select 1, leaving 40 pounds.

At this point if we pick items 1 and 2 the total value is 160.

If we pick items 1 and 3 the total value is 180.

The optimal solution is to pick items . The total value of this solution is .


next up previous
Next: Dynamic Programming for 0-1 Up: CSE 2320: Algorithms and Previous: Dynamic Programming for Activity
Copyright © 1998 The University of Texas at Arlington