A Linear Programming Approach to the Cutting Stock Problem—Part II 1: The Lexicographic Knapsack Method Terminates, and M_1 Equals max(c_1, the Knapsack Optimum for the Longest Stock Length L_1)Research Paper
Motivation
The cutting stock problem asks how to cut standard stock rolls of length into pieces of demanded lengths so that the demands are met at least cost. Gilmore and Gomory solved its linear programming relaxation by column generation (Part I, Opns. Res. 9 (1961)): every cutting pattern is a column, and the column to bring into the basis is found by solving an integer knapsack problem whose objective is given by the current dual prices. In Part II (Opns. Res. 11 (1963)) they replaced the dynamic-programming knapsack solver of Part I by a lexicographic enumeration with a bound test, the Knapsack Method, and reported it to be about five times as fast as dynamic programming on their problem set (p. 866). The method is an early enumeration-with-bounds (branch-and-bound type) procedure for the integer knapsack, and the same pricing problem remains the inner loop of column generation for cutting stock, bin packing and their many variants.
Setting
There are demanded lengths with linear programming prices , and standard stock lengths with costs . A column for is a vector of nonnegative integers with . The knapsack problem (1) for is
and the quantity to compute is : a column improves the linear program exactly when .
For a prefix write and . Step (1) sorts the data, and , and appends a slack item with , . The method then generates vectors in decreasing lexicographic order:
- Steps (2) and (7) fill the coefficients after a prefix greedily, , for at the start and later.
- Step (3) records as the new for each with and .
- Step (4) finds the last nonzero coefficient .
- Step (5) lowers by one and looks for the smallest with and . This is the bound obtained by relaxing the integrality of .
- Step (6) backs up to the previous nonzero coefficient when no such exists, and stops when there is none.
In Lean the method is a transition system Step on states (a, s, t, M, phase). Reachable means reachable from the start state of Step (2).
Formalization targets
Goal: the method terminates and computes
Under Step (1)'s ordering, with and :
and at the end every is or the price of a column for , with . With one stock length () this is the paper's correctness claim in full: the method solves the knapsack problem (1).
Milestones
- Steps (2)/(7): the greedy completion is the lexicographically largest extension of a prefix that fits the capacity.
- Step (4): the lexicographic predecessor of a fitting vector extends .
- The relaxation bound for every fitting extension.
- After the inequality of Step (5)'s test fails, no vector between and the successor of Step (6) improves .
- The vectors tested in Step (3) strictly decrease lexicographically.
- The invariant on entry to Step (3).
- Identical prices: among lengths with equal prices only the shortest is needed (p. 869).
Significance
The goal certifies the pricing oracle of the Gilmore–Gomory column-generation method: the knapsack solver it calls returns the true optimum. The pricing step is exact only if that holds, and so is the conclusion "no improving column exists, the LP is solved". Milestones 1–4 are reusable on their own. They are the textbook ingredients of lexicographic and depth-first branch-and-bound for the integer knapsack: the greedy completion, the density-ordered LP bound, and the pruning rule.
The paper's argument is a short paragraph, "clear from the order in which the -vectors are generated". Writing it out shows that the claim is false for several stock lengths as the steps are printed. With , , and , the method tests . The test of Step (5) at then fails for only because , Step (6) stops, and the run ends with while the column has price 2. This mission therefore states what the printed algorithm does achieve. The result is the full claim for and for the longest stock length in general. A sorry-free Lean proof of the counterexample run accompanies the mission. No part of the method or its correctness has been formalized before, as far as a search of the platform shows.
Difficulty
The method skips large parts of the lexicographic order in three ways:
- Step (7) jumps to the greedy completion for rather than .
- Step (6) jumps past every smaller value of once one test fails.
- Step (3) updates only .
Each skip has to be justified by a bound that holds for every vector skipped, and the justifications interact. A skipped vector may fit a longer stock length but not , and the bound for must cover exactly those vectors. The invariant that survives all three moves is not the naive "every vector above the current one has been examined": the vectors are not examined, only bounded. Termination needs the lexicographic decrease together with finiteness of the fitting vectors, and progress needs the reachability invariants and that make Step (5) meaningful.
Formalization scope
-
Items are
Fin mfrom 0. The paper's level is a natural number, and the prefix is the coordinates with index< s. Stock lengths areFin k, and is index 0. The slack item enters only through and at . The lexicographic order is Mathlib'sPi.Lex, and isNat.floor. -
is the predicate
IsKnapsackMax, never a real supremum, which would be 0 on an empty set. The algorithm's output is never defined as the maximum. The goal includes termination and progress, so its correctness clause is not vacuous. Every invariant is stated for reachable states only. -
The goal adds two disclosed hypotheses:
- : demanded lengths.
- : with a negative price the method is wrong, and the paper applies it to cutting-stock prices, which are nonnegative.
Step (1) is a hypothesis on the data, not a step.
-
The goal also makes these corrections:
- The claim is narrowed. For every it states and attainment, and the upper bound for only (see Significance).
- The lexicographic order is repaired. The page's definition misses vectors that differ in their first coefficient.
- Step (7) reads λ·(α)_m. The page's "satisfies " is read as .
- Step (4) gets a stopping case. On the zero vector, where the page has no case, the method stops.
- Milestone 4 is stated for the failed inequality, not for a failed test, because the failed test is what makes the page's successor claim false.
-
Not formalized:
- Step (3′), the variant computing .
- The record of patterns.
- The dynamic-programming recursion and the timing estimates.
Contributions welcome: proofs of the milestones, and a corrected multi-length variant of the method with a proof that it computes every .
Selected references
- P. C. Gilmore, R. E. Gomory, A linear programming approach to the cutting stock problem—Part II, Operations Research 11(6) (1963), 863–888. https://doi.org/10.1287/opre.11.6.863
- P. C. Gilmore, R. E. Gomory, A linear programming approach to the cutting-stock problem, Operations Research 9(6) (1961), 849–859. https://doi.org/10.1287/opre.9.6.849
- G. B. Dantzig, Discrete-variable extremum problems, Operations Research 5(2) (1957), 266–288. https://doi.org/10.1287/opre.5.2.266