Reading the Answer
Traceback the Items
The optimal value is only half the story; traceback recovers the subset that achieves it. The path moves upward through the table, marking rows where an item was taken. This lesson turns the DP value into a concrete certificate and states the pseudo-polynomial scope honestly.
Traceback path
The traceback starts at the final cell and follows 4 cells. Why: each step asks whether the current row changed the value compared with the row above. If the value did not change, the current item was unnecessary for this optimum; if it did, the path moves to the remaining capacity after taking that item.
Chosen items
The chosen items are item 2 and item 3. Why: those are the rows where traceback takes the item, so they turn the table's value into an actual subset. This matters because an optimal value alone is not a packing plan; the certificate needs to show which items realize it.
Subset certificate
Their total weight is 7, equal to capacity 7, and total value is 9. Why: the chosen subset both fits the capacity and achieves the table's optimum. Feasibility and value meet in the same object, so the traceback is the constructive certificate behind the final DP cell.
Scope of DP
This DP table is exact here, but table size grows with item count times capacity magnitude. Why: knapsack DP is pseudo-polynomial, not a small-table guarantee for every encoding. That scope statement is part of the honesty boundary: the arithmetic is exact for this instance, while the method's running size depends on the numeric capacity.
Diagram note
Path cells show the traceback route; starred rows mark chosen items. The display connects two claims: the final cell gives the best value, and the path names a subset that attains it. The exact proof is for zero-one integer knapsack with this pinned item set and capacity. Pixel positions are rounded for layout; every number shown is exact.