Solving Cutting and Packing Problems with Extended Integer Programming Formulations
Total Page:16
File Type:pdf, Size:1020Kb
Solving cutting and packing problems with extended integer programming formulations François Clautiaux Mexico City, April 9th, 2019 Introduction Introduction Classical Integer programming formulation for CSP Extended formulations for the cutting-stock problem Extended formulations for a 2-dimensional cutting-stock problem Conclusion References Introduction Introduction We focus on MILP methods for solving 1D and 2D cutting problems The best exact methods known so far are based on extended formulations These formulations have an exponential size, but an interesting structure We show how they can be used effectively and why they actually work Introduction Mixed-Integer Linear Programs n minfcx : Ax ≥ a; x 2 Z g Linear programs can be solved efficiently, even for large-size models Some integer linear programming models can only be solved for medium sizes Introduction Solving an MILP by branch-and-bound max 17x1 + 12x2 t.q. 10x1 + 7x2 ≤ 40 x1 + x2 ≤ 5 x1 ; x2 2 R+ x1 = 1; 6666; x2 = 3; 3333; u = 65 x ≤ 1 1 x1 ≥ 2 max 17x + 12x 1 2 max 17x + 12x t.q. 10x + 7x ≤ 40 1 2 1 2 t.q. 10x + 7x ≤ 40 x + x ≤ 5 1 2 1 2 x + x ≤ 5 x ≤ 1 1 2 1 x ≥ 2 x ; x 2 1 1 2 R+ x ; x 2 x = 1; x = 4; u = 63 1 2 R+ 1 2 x = 2; x = 2; 8571; u = 64; 286 Feasible solution 1 2 x2 ≤ 2 x2 ≥ 3 max 17x1 + 12x2 max 17x1 + 12x2 t.q. 10x1 + 7x2 ≤ 40 t.q. 10x1 + 7x2 ≤ 40 x1 + x2 ≤ 5 x1 + x2 ≤ 5 x1 ≥ 2 x1 ≥ 2 x2 ≤ 2 x2 ≥ 3 x1 ; x2 2 R+ x1 ; x2 2 R+ > x1 = 2; 6; x2 = 2; u = 63 No solution ! Introduction Important features of an ILP Important features of an integer linear program I Quality of the linear relaxation (good bounds) I Number of symmetries (impacts the size of the branch-and-bound tree) I Size of the model (impacts the time needed to solve the linear relaxation, and the size of the branch-and-bound tree) Introduction Quality of a formulation x2 x2 5 5 (7) (7) 3 3 (6) (5) (6) (5) 2 2 (4) (4) 1 1 1 2 3 4 x1 1 2 3 4 x1 The choice of the formulation is key. Objective: being as close as possible to the ideal linear formulation n (i.e. the convex hull of integer solutions conv(Ax ≥ a; x 2 Z )). But the cost in size may be large! Introduction Extended formulations Typically replacing individual decisions by sequences/sets of decisions respecting some constraints. I arcs ! paths I individual elements ! subset I ... Classical Integer programming formulation for CSP Introduction Classical Integer programming formulation for CSP Extended formulations for the cutting-stock problem Extended formulations for a 2-dimensional cutting-stock problem Conclusion References Classical Integer programming formulation for CSP Cutting-stock problem Cutting-Stock Problem Given a list of orders i = 1;:::; n, each having a size ci and a demand di , and an integer value C (roll size), find the minimum number of cutting rolls to satisfy the item demand in such a way that the sum of the item sizes in one roll is always smaller than C. The problem is NP-hard in the strong sense. Only known to be NP-complete in 2006 [Eisenbrand and Shmonin, 2006] The problem becomes a bin packing problem if the demands are small. Classical Integer programming formulation for CSP Classical model [Kantorovich] X yj : 1 if bin j is open, 0 otherwise min yj j2M xij : how many times item i is X cut from bin j ci xij ≤ Cyj ; j 2 M i2N m : an upper bound on the X number of bins needed xij ≥ di ; i 2 N j2M N = 1;:::; n and xij 2 N; i 2 N ; j 2 M M = 1;:::; m. yj 2 f0; 1g; j 2 M Classical Integer programming formulation for CSP Analysis of the classical model Important features of an integer linear program I Quality of the linear relaxation I Number of symetries I Size of the model Classical Integer programming formulation for CSP Quality of the linear relaxation (1) The optimal solution of the linear relaxation of SC is always equal Pn di ci to i=1 C . m m X X X c x ≤ Cy 6 i ij j 3 4 j=1 i=1;:::;n j=1 5 n n 2 X X X ci xij ≥ ci di 3 i=1 j=M i=1 1 4 6 =) n m y1 = 1 y2 = 1 y3 = 1 y4 = c6=C X X ci di ≤ Cyj i=1 j=1 Quality of the linear relaxation (2) Classical Integer programming formulation for CSP to The optimal solution of the linear relaxation of SC is always equal P i n = 1 d C i c i . C=2 + Worst case : C=2 + 2 1 C=2 + OPT C=2 + Classical Integer programming formulation for CSP Size of model (SC) Besides being (very) weak, the model is not even polynomial in size! m constraints, where m is the number of bins in the solution =) Pn depends on i=1 di Pn Size of the instance: O( i=1 log di ). Pn The model is pseudo-polynomial (exponential in O( i=1 log di )). Classical Integer programming formulation for CSP A polynomial size version of (SC) Theorem (Eisenbrand and Shmonin, 2006) The number of different cutting patterns in an optimal solution is Pn no larger than LD = 2 i=1 log di . Remark A pattern cannot be used more than dmax = maxfdi : i 2 I g k I binary variable yjk means that bin number j is replicated 2 times I integer variable xijk is the number of times i is used in each bin j replicated 2k times For the sake of simplicity, assume that all numbers are powers of 2. Classical Integer programming formulation for CSP A polynomial size version of (SC) LD log dmax X X k min 2 djk j=1 k=0 X ci xijk ≤ Cyjk ; j = 1;:::; LD; k = 0;:::; log dmax i2N LD log dmax X X k 2 xijk = di ; i 2 N j=1 k=0 xijk 2 N; i 2 N ; j = 1;:::; LD; k = 0;:::; log dmax yjk 2 f0; 1g; j = 1;:::; LD; k = 0;:::; log dmax Classical Integer programming formulation for CSP Symmetries Model SC has many symmetries The same exact solution that uses t bins occurs t! times in the branch&bound tree. 3 3 6 6 2 2 4 4 1 5 5 1 Same solution, different values for variables xij . Classical Integer programming formulation for CSP Removing symmetries from (SC) in the binary case In the binary case (bin packing), use "representative" model instead. New variables: xij means that i is packed in a bin whose item of smallest index is j (xii means that a bin is open with smallest index i). X min xii i=M X ci xij ≤ (C − ci )xjj ; j = 1;:::; n − 1 i=j+1;n X xij = 1; i = 1;:::; n j=1;:::;i xij 2 N; i = 1;:::; n; j = 1;:::; i Classical Integer programming formulation for CSP SC: summary This model has all possible weaknesses! (symmetries, linear relaxation, size) But for moderate size data, it is actually not so bad Modern MILP solvers are able to add effective valid inequalities and detect symmetries ; modern computers are able to enumerate many solutions in a short amount of time Still not the best method in general Extended formulations for the cutting-stock problem Introduction Classical Integer programming formulation for CSP Extended formulations for the cutting-stock problem Dantzig-Wolfe reformulation Arc-flow model Extended formulations for a 2-dimensional cutting-stock problem Conclusion References Extended formulations for the cutting-stock problem Dantzig-Wolfe reformulation Gilmore-Gomory model for the cutting-stock problem P: set of all possible patterns (valid set of items for one bin). For each p 2 P, a variable λp indicating the number of times p is used in the solution. p We denote by ai the number of times item i appears in p. X min λ p 3 3 5 p2P 3 X p s.t. ai λp ≥ di 8i 2 N 3 p2P 7 5 5 3 λp 2 N 8p 2 P λ1 = 1 λ2 = 2 λ3 = 1=3 λ4 = 0 Extended formulations for the cutting-stock problem Dantzig-Wolfe reformulation Gilmore-Gomory model for the cutting-stock problem P: set of all possible patterns (valid set of items for one bin). For each p 2 P, a variable λp indicating the number of times p is used in the solution. p We denote by ai the number of times item i appears in p. X min λp 3 3 p2P 5 X p 3 s.t. ai λp ≥ di 8i 2 N 3 p2P 7 5 5 λp 2 R+ 8p 2 P 3 λ1 = 1 λ2 = 2 λ3 = 1=3 λ4 = 0 MASTER PROBLEM Extended formulations for the cutting-stock problem Dantzig-Wolfe reformulation Column generation The model has typically an exponential number of variables, but only a (hopefully) small subset is needed =) dynamic column generation Column generation algorithm I Build a Restricted Master Problem (RMP) with a subset of columns/variables I Do I Solve RMP to optimality ; obtain a dual vector π I Solve the pricing subproblem I While a variable of negative reduced cost can be found. Extended formulations for the cutting-stock problem Dantzig-Wolfe reformulation Subproblem X X min λp max di πi p2P i2N X p X p s.t.