The DP table behind this instance has tens of thousands of cells, too many to draw. This chapter shows the value and the selection the table certifies instead, and states plainly what it does not claim about larger capacities.

highlighted = computed this step

The table itself is too large to show

The full DP table has 43401 cells. Why: it is one row per item prefix and one column per capacity value, the same table chapter two fills by hand at four rows and eight columns — the algorithm scales cleanly to this size, but a grid this large stops being a useful picture even though every cell in it is still exact.

(50+1)×(850+1)=43401(50+ 1)\times(850+ 1)=43401
Same instance, two exact methodsThe fifty-item instance both the small worked table and the solver reason about.50 items, capacity 850I1w7v360I2w0v83I3w30v59I4w22v130I5w80v431I6w94v67I7w11v230I8w81v52I9w70v93I10w64v125I11w59v670I12w18v892I13w0v600I14w36v38I15w3v48I16w8v147I17w15v78I18w42v256I19w9v63I20w0v17I21w42v120I22w47v164I23w52v432I24w32v35I25w26v92I26w48v110I27w55v22I28w6v42I29w29v50I30w84v323I31w2v514I32w4v28I33w18v87I34w56v73I35w7v78I36w29v15I37w93v26I38w44v78I39w71v210I40w3v36I41w86v85I42w66v189I43w31v274I44w65v43I45w0v33I46w79v10I47w20v19I48w65v389I49w52v276I50w13v312items 50capacity 850DP optimum 7534

Show the answer, not the table

This chapter shows the selected items and the optimal value instead of the table that produced them. Why: the earlier chapters exist to show how the table thinks; once the table is too big to look at, what still transfers is the value and the selection it certifies, not the grid.

answer shown; table computed, not drawn\text{answer shown; table computed, not drawn}
Same instance, two exact methodsThe fifty-item instance both the small worked table and the solver reason about.50 items, capacity 850I1w7v360I2w0v83I3w30v59I4w22v130I5w80v431I6w94v67I7w11v230I8w81v52I9w70v93I10w64v125I11w59v670I12w18v892I13w0v600I14w36v38I15w3v48I16w8v147I17w15v78I18w42v256I19w9v63I20w0v17I21w42v120I22w47v164I23w52v432I24w32v35I25w26v92I26w48v110I27w55v22I28w6v42I29w29v50I30w84v323I31w2v514I32w4v28I33w18v87I34w56v73I35w7v78I36w29v15I37w93v26I38w44v78I39w71v210I40w3v36I41w86v85I42w66v189I43w31v274I44w65v43I45w0v33I46w79v10I47w20v19I48w65v389I49w52v276I50w13v312items 50capacity 850DP optimum 7534

Scope of the chapter

Nothing here replaces the earlier chapters: the DP method is still exact on an instance of this size, and the solver's role is providing an independent second computation, not a better answer. Why: dynamic programming's cost is pseudo-polynomial in the capacity number, so a much larger capacity would eventually make the table too slow to fill, not just too large to draw — this chapter makes no claim about where that happens.

exact here; no runtime promise at other capacities\text{exact here; no runtime promise at other capacities}
Same instance, two exact methodsThe fifty-item instance both the small worked table and the solver reason about.50 items, capacity 850I1w7v360I2w0v83I3w30v59I4w22v130I5w80v431I6w94v67I7w11v230I8w81v52I9w70v93I10w64v125I11w59v670I12w18v892I13w0v600I14w36v38I15w3v48I16w8v147I17w15v78I18w42v256I19w9v63I20w0v17I21w42v120I22w47v164I23w52v432I24w32v35I25w26v92I26w48v110I27w55v22I28w6v42I29w29v50I30w84v323I31w2v514I32w4v28I33w18v87I34w56v73I35w7v78I36w29v15I37w93v26I38w44v78I39w71v210I40w3v36I41w86v85I42w66v189I43w31v274I44w65v43I45w0v33I46w79v10I47w20v19I48w65v389I49w52v276I50w13v312items 50capacity 850DP optimum 7534

Diagram note

The grid is the same fifty-item instance as the earlier lessons in this chapter. Pixel positions are rounded for layout; every number shown is exact.

same instance, chapter-wide\text{same instance, chapter-wide}
Same instance, two exact methodsThe fifty-item instance both the small worked table and the solver reason about.50 items, capacity 850I1w7v360I2w0v83I3w30v59I4w22v130I5w80v431I6w94v67I7w11v230I8w81v52I9w70v93I10w64v125I11w59v670I12w18v892I13w0v600I14w36v38I15w3v48I16w8v147I17w15v78I18w42v256I19w9v63I20w0v17I21w42v120I22w47v164I23w52v432I24w32v35I25w26v92I26w48v110I27w55v22I28w6v42I29w29v50I30w84v323I31w2v514I32w4v28I33w18v87I34w56v73I35w7v78I36w29v15I37w93v26I38w44v78I39w71v210I40w3v36I41w86v85I42w66v189I43w31v274I44w65v43I45w0v33I46w79v10I47w20v19I48w65v389I49w52v276I50w13v312items 50capacity 850DP optimum 7534