01The knapsack problem
The lecture states it like this: there are N items, item i has weight wᵢ > 0 and value pᵢ > 0. Choose a subset whose total weight does not exceed the knapsack capacity W and whose total value is maximal.
In general this problem is NP-complete: no polynomial algorithm for it is known. For small inputs dynamic programming solves it, and that is the second half of the lecture (stage 10).
Our running example is the lecture's: three items of 10, 20 and 30 kg worth $60, $100 and $120, and a knapsack of capacity 50. All three together weigh 60, so something has to stay behind.