Knapsack and the DP Table
A lightweight execution-visualization book.
The Problem
The 0-1 Knapsack
The DP Idea
Filling the Table
Base Case and First Rows
Take or Leave
The Filled Table
Reading the Answer
The Optimal Value
Traceback the Items
Solved at Scale
A Bigger Instance
Solved with CP-SAT
Cross-Checking the Optimum
Honest Solver Scope