0/1 Knapsack Problem
Select items to maximize value under a capacity constraint.
Also called: Knapsack Problem · 0/1 Knapsack · 배낭 문제
Last verified: 2026-05-27
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.
Related nodes
See the depth-1 graph below.
Claims & evidence
Every relationship is a claim with an equivalence level and an evidence grade. 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 |
Neighborhood
Direct graph neighbors. Toggle depth to expand.
See also
Not directly linked, but conceptually close — by the connections and descriptions they share.
- 2D Bin PackingFormal problem4 connections in common
- Guillotine CuttingFormal problem3 connections in common
- Wäscher TypologyConcept2 connections in common
- Column GenerationMethod2 connections in common
- Pallet LoadingFormal problem2 connections in common
- 2D Strip PackingFormal problem2 connections in common