Example
Build one 0/1 knapsack row from a previous row and one item.
highlighted = computed this step
Step 1 — Previous row and item
Compute the highlighted combinatorics value.
previous row, item((0, 0, 6, 7, 7, 13, 13, 13), (C, 4, 10))
Step 2 — Capacity 0
Compute the highlighted combinatorics value.
capacity, skip, take, best(0, 0, -, 0)
Step 3 — Capacity 1
Compute the highlighted combinatorics value.
capacity, skip, take, best(1, 0, -, 0)
Step 4 — Capacity 2
Compute the highlighted combinatorics value.
capacity, skip, take, best(2, 6, -, 6)
Step 5 — Capacity 3
Compute the highlighted combinatorics value.
capacity, skip, take, best(3, 7, -, 7)
Step 6 — Capacity 4
Compute the highlighted combinatorics value.
capacity, skip, take, best(4, 7, 10, 10)
Step 7 — Capacity 5
Compute the highlighted combinatorics value.
capacity, skip, take, best(5, 13, 10, 13)
Step 8 — Capacity 6
Compute the highlighted combinatorics value.
capacity, skip, take, best(6, 13, 16, 16)
Step 9 — Capacity 7
Compute the highlighted combinatorics value.
capacity, skip, take, best(7, 13, 17, 17)
combinatorics-search
Every row is intentionally ordered and pinned to the lesson specification.