173
Knapsack problem FAQ
Those 3 lb are worth $2,000! $2,000 from the iPhone + $2,000 from the
old subproblem: that’s $4,000. A new max!
Here’s the new final grid.
Question: Would the value of a column ever go
down
? Is this possible?
Think of an answer before reading on.
Answer: No. At every iteration, you’re storing the current max estimate.
The estimate can never get worse than it was before!
Dostları ilə paylaş: