Item | Capacity | Value |
---|---|---|
A | 6 | 100 |
B | 2 | 50 |
C | 2 | 51 |
for each item type i compute the value, vi = pi/wisort items by value for each item type ordered by the value (large to small) until the knapksack is full take as many of that item as will fit into the knapsack