Example
Choose the feasible subset with maximum value. Among the packings that fit within the weight limit, the winner is the one whose items sum to the greatest total value. Because every candidate here already respects the capacity, the decision reduces to a straight comparison of totals, and the highest is the optimal knapsack for this instance.
highlighted = computed this step
Step 1 — Best value
Compute the highlighted combinatorics value.
best value18
Step 2 — Best subset
Compute the highlighted combinatorics value.
chosen subset(A, D)
Step 3 — Verdict
Compute the highlighted combinatorics value.
verdictbest feasible subset
combinatorics-search
Every row is intentionally ordered and pinned to the lesson specification.