Bounded knapsack problem
ID: bounded-knapsack-problem
The bounded knapsack problem adds per-type upper limits to the integer knapsack problem. It interpolates between 0-1 knapsack problem () and the unbounded knapsack problem.
Processing types one at a time gives . The previous-type index prevents the recurrence from exceeding the allowed count. For large , splitting counts into power-of-two bundles and a final remainder reduces the bounded type to logarithmically many 0-1 knapsack problem items while preserving every allowable count.
New to topics? Read the docs here!