0/1 Knapsack Problem
Select items to maximize value under a capacity constraint.
Also called: Knapsack Problem · 0/1 Knapsack · 배낭 문제
Definition
Given items each with weight and value , choose to maximize subject to .
Example
Suppose a knapsack of capacity and four items:
| Item | Weight | Value |
|---|---|---|
| 1 | 5 | 10 |
| 2 | 4 | 7 |
| 3 | 6 | 9 |
| 4 | 3 | 4 |
Among the subsets whose weights sum to at most 10, the highest total value is item set : weight , value . Notably, item set fills the capacity exactly at weight yet reaches only value — packing more weight does not make the solution better.
Why it's here
The knapsack problem connects to cutting & packing in two ways: (1) a shared method — dynamic programming, and (2) the pricing subproblem of 1D Cutting Stock's column generation is itself a knapsack problem.
Claims & evidence
Every relationship is a claim with an evidence grade; applicable problem-to-problem relationships also carry an equivalence level. See the evidence policy.
| Relationship | Claim | Equiv. | Evidence | Sources |
|---|---|---|---|---|
| uses methodDynamic Programming | The 0/1 knapsack problem can be solved exactly by pseudo-polynomial dynamic programming. | — | A |
|
| direct benchmarkOR-Library | OR-Library distributes standard test instances including the knapsack family. | — | B |
|
| shares method with1D Cutting Stock | In cutting-stock column generation the pricing subproblem appears as an (integer) knapsack problem, methodologically linking the two. | E3 | A |
|
| uses methodBranch and Bound | Besides dynamic programming, the 0/1 knapsack problem is also solved exactly by branch and bound. | — | A |
|
| uses methodInteger Linear Programming | The 0/1 knapsack problem is directly formulated as a 0/1 integer linear program with binary variables and a single capacity constraint. | — | A |
|
| open-source implementationGoogle OR-Tools | Google OR-Tools provides an open-source KnapsackSolver for the 0/1 knapsack problem. | — | C |