next up previous
Next: Up: Previous:

Fractional Knapsack Problem

Now we need to show that an initial greedy choice of item h leads to an optimal solution. We can make the greedy choice first.

Case I:
If W < wh, then L(h) = W and for all j $\neq$ h L(j) = 0 is the only take.

We can fill the knapsack with the highest value-per-pound item.

Case II:
There is room left after greedy choice. L(i), L(j) > 0, i $\neq$ j. Assume item i was the first choice and j = h a subsequent choice.

Thus, V = L(i) \(\frac{v_i}{w_i}\) + L(h) \(\frac{v_h}{w_h}\).

If we choose the same amount L(h) of item h first (we cannot choose more or we would have by the above result), then the value will be

V' = L(h) \(\frac{v_h}{w_h}\) + L(i) \(\frac{v_i}{w_i}\)

V' = V

Thus we can make the greedy choice first.


next up previous
Next: Up: Previous: