Mixed-Length Bar Nesting (Cutting Stock)

What barstock-cutlist says it does not do: "Mixed-length nesting, end trim, and clamping loss are not modeled." One piece length is division; several at once is packing, and the question becomes which pieces share a stick. Sorted longest-first and dropped into the first stick with room, a list of 4 at 62 in, 6 at 38, 9 at 27, and 12 at 14.5 nests into 4 sticks of 20 ft at 93.0% yield -- and the first stick comes out at ZERO drop, 62+62+62+38+14.5 plus four kerfs filling 239 in exactly. Longest-first is what makes it work: the big pieces have the least flexibility, so they get placed while every stick is empty and the short ones fill the gaps. Kerf is charged per CUT, so a stick cut clean to its end takes one fewer than a stick with drop left. Reports the pattern for every stick, the longest single drop worth saving, and a material lower bound -- with an honest note when the heuristic may not be optimal.

Run the calculator

Formula and source

usable = stock - end trim; pieces sorted descending; first-fit-decreasing places each piece in the first stick where used + length + (kerf if the stick is not empty) <= usable, opening a new stick otherwise; total kerf = sum over sticks of (pieces on that stick - 1) x kerf; drop = total stock - part - kerf - trim; yield = part / total stock; lower bound = ceil((total part + (pieces - sticks) x kerf) / usable).

One-dimensional cutting-stock, packed by the first-fit-decreasing heuristic - a standard, near-optimal bin-packing method, not a proprietary nesting algorithm.

Audience

This tile is built for trades and the adjacent professions in the Carpentry and Construction group. The interactive calculator runs entirely in your browser. No account, no fee, no advertising, no tracking.

Related tools

Posture

Rough Logic answers the math question the working professional asks on the job. The site is a calm, fast, ad-free, account-free, ever-free reference. It does not interpret code. It does not replace the licensed professional. It does not store your inputs. The Authority Having Jurisdiction governs all installations and inspections.