Read item weights and values for a tiny knapsack. This is a small deterministic example, not solver engineering.

Example

Read item weights and values for a tiny knapsack.

highlighted = computed this step

Step 1 — Capacity

Set up the exact small combinatorics values.

capacity7\begin{array}{c|c}\text{capacity}&\text{7}\end{array}

Step 2 — Items

Compute the highlighted combinatorics value.

item, weight, value((A, 2, 6), (B, 3, 7), (C, 4, 10), (D, 5, 12))\begin{array}{c|c}\text{item, weight, value}&\hlmath{\text{((A, 2, 6), (B, 3, 7), (C, 4, 10), (D, 5, 12))}}\end{array}
combinatorics-search Every row is intentionally ordered and pinned to the lesson specification.