You're packing a bag for a trip and it can only hold so much weight. Every item is worth something to you, but you can't take them all. Which ones do you pick to get the most value without going over the limit?
That's the knapsack problem, and the same question appears far from any backpack: a budget that can fund only some projects, a truck that can carry only so much cargo, an ad slot that can show only a few items. In each case you choose a subset of things, each with a "cost" (weight) and a "benefit" (value), to maximize benefit without exceeding a fixed capacity.
It sounds like something you could eyeball. But as the list of items grows, the number of possible combinations explodes — and the obvious shortcuts can quietly leave value on the table.
Comments
Loading comments...