next up previous
Next: Up: Previous:

Question:

How much of which items should the thief take to maximize the value of the loot?



Greedy Algorithm: Take as much of the item with the highest value per pound (vi/wi) as you can. If you run out of that item, take from the next highest (vi/wi) item. Continue until knapsack is full.

Knapsack Problem Variant
Applet courtesy of the tutOR project,
Department of Mathematics and Statistics
University of Melbourne


next up previous
Next: Up: Previous: