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
*v*_{i}/*w*_{i}) as you can. If you run out of that item,
take from the *v*_{i}/*w*_{i}) item. Continue until knapsack
is full.

Knapsack Problem Variant

Applet courtesy of the tutOR project,

Department of Mathematics and Statistics

University of Melbourne

Applet courtesy of the tutOR project,

Department of Mathematics and Statistics

University of Melbourne