What Is the Bin Packing Algorithm?
Behind every cutting optimizer is a packing algorithm. The bin packing problem asks a deceptively simple question: given a set of items and containers of fixed size, how do you fit everything using the fewest containers? In stock cutting, the "items" are your parts and the "bins" are your sheets.
The core idea
In one-dimensional bin packing, you pack lengths into fixed-length bins — for example cutting lengths of pipe from standard bars. In two-dimensional bin packing, items have width and height and must be placed without overlapping inside rectangular sheets. Sheet cutting is a 2D bin packing problem.
The problem is "NP-hard" (it reduces to the knapsack problem), meaning there is no known fast method to guarantee the perfect answer for large inputs. Instead, algorithms use smart heuristics to find very good solutions quickly.
Common heuristics
- First Fit: place each item in the first bin where it fits.
- Best Fit: place each item in the bin that leaves the least leftover space.
- First Fit Decreasing: sort items largest-first, then apply First Fit — usually much better.
- Guillotine & MaxRects: 2D strategies that track free rectangles as parts are placed.
From algorithm to cutting layout
A 2D packer like MaxRects keeps a list of empty rectangles on the sheet. Each time it places a part, it splits the remaining space into new free rectangles and chooses placements that waste the least area. Repeating this across all parts produces a complete layout.
Real cutting adds constraints the pure algorithm must respect: kerf between parts, optional 90° rotation, grain locking, and trim margins. A production optimizer layers these on top of the packing core.
Why heuristics instead of brute force
Even a modest job of 50 parts has astronomically many possible arrangements. Brute force would take far too long. Heuristics deliver a near-optimal layout in seconds, which is exactly what a workshop needs.
Frequently asked questions
Is bin packing the same as the cutting stock problem?
They are closely related optimization problems. Bin packing minimizes the number of bins for a set of items; the cutting stock problem minimizes stock used to fulfill demand. Cutting optimizers draw on both.
Which algorithm does CutList Machine use?
It uses a 2D rectangle-packing approach (MaxRects-style) enhanced with kerf, rotation, and grain constraints to produce practical, production-ready cutting layouts.
Put this into practice
Plan tighter layouts and cut less waste with the free CutList Machine optimizer.
Launch the optimizerRelated articles
What Is Stock Cutting?
A plain-English introduction to stock cutting, the cutting stock problem, and how optimization saves material and money.
CNCCNC Nesting Explained
What nesting means on a CNC router or laser, and why it unlocks higher material yield.
OptimizationCut List Optimization Best Practices
A checklist of habits that consistently produce tighter layouts and less waste.