From rolls to patterns
The chapter’s example has 10-foot master rolls. Customers demand 23 rolls of length 2, 25 rolls of length 3, 30 rolls of length 4, and 11 rolls of length 5.
A pattern is a vector p=(a,b,c,d). It is feasible when 2a+3b+4c+5d≤10. Pattern (2,0,0,1), for example, cuts two 2-foot rolls and one 5-foot roll from a master roll, leaving one foot unused.
The compact formulation
The primal has many variables. The dual has one constraint for every possible pattern. That lets us search for missing constraints instead of writing every pattern in advance.
Interactive Pattern lab
Edit the roll length, item lengths, and demands. The page enumerates feasible patterns and turns each pattern into its corresponding dual constraint.
Instance data
Selected pattern
—Feasible patterns
nonzero onlyThe table is sorted by waste, then by number of pieces. For the chapter instance there are 29 feasible nonzero patterns.
The missing constraint is a knapsack problem
Given a candidate dual solution ȳ, every pattern must satisfy p·ȳ≤1. The worst possible pattern is found by solving:
If the optimum is larger than 1, the corresponding pattern gives a violated dual constraint. If it is at most 1, all dual constraints are satisfied.
Why this is column generation
The dual view finds a violated constraint. In the primal LP, the same object is a useful missing variable: a cutting pattern with negative reduced cost.
The page below solves the restricted dual exactly by enumerating basic feasible solutions. That is enough for the small teaching examples in this chapter.
Interactive Knapsack pricing oracle
Choose dual values. The oracle searches every feasible cutting pattern and reports the one with maximum p·y.
Dual values
chapter instanceBest priced pattern
—Interactive Column generation / cutting-plane workbench
Start with only a few patterns, solve the restricted dual, price a new pattern by knapsack, add the violated pattern, and repeat.
Controls
not solvedCurrent restricted dual solution
Iteration log
Chapter replay
D′₁ → D′₄The buttons above load the same restricted duals used in the chapter. The final solution is y=(2/10,3/10,4/10,5/10), where the knapsack objective is at most 1 because it is one tenth of the roll-length constraint.
Current pattern constraints
p·y ≤ 1Pricing output
—Interactive Recover the primal solution
Once no dual constraint is violated, strong duality gives the primal optimum. For the chapter data, the fractional LP optimum is 29.6 master rolls.
Restricted primal solve
—This solves the current restricted primal LP by enumerating basic feasible solutions. It is designed for the small examples in the chapter.
Demand coverage
produced − demandInteger reality check
optionalThe chapter assumes monthly repeated demand, so fractional roll counts are acceptable. If you force whole master rolls, the page can compute an exact small integer cover by dynamic programming.
The algorithmic pattern
When an LP has too many variables, solve a restricted version, use the dual solution to search for a missing useful variable, and add that variable only if it improves the model.
Why knapsack appears
A cutting pattern is exactly a way of packing item lengths into one master roll. Therefore the pricing problem is a knapsack problem whose item values are the current dual prices.
This is the same idea used in much larger column-generation models, including industrial scheduling and routing models.
