next up previous
Next: The Fractional Knapsack Problem Up: CSE 2320: Algorithms and Previous: Example: Fractional Knapsack Problem

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 value per pound (vi/wi) as you can. If you run out of that item, take from the (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



Copyright © 1998 The University of Texas at Arlington