Knapsack Problem
In the knapsack problem, we are given a positive integer knapsack capacity and items indexed from to .
Item has positive integer value and weight
We wish to identify a maximum value set of items with weight at most .
Note: no polynomial time algorithm is known for this problem.
Fractional Knapsack Variation
In the fractional knapsack problem, we are allowed to take a fractional amount of any item.
Important Observation
Let be an item with maximum “value density” .
We claim that some optimal solution includes a fraction of item .
To prove this claim, we can use an exchange argument:
- Let be an optimal solution that includes a fraction of item
- Observe that weight of is at least
- Modify by removing fractional items not equal to with total weight