Linear Programming Solvers: the State of the Art
Total Page:16
File Type:pdf, Size:1020Kb
Linear Programming solvers: the state of the art Julian Hall School of Mathematics, University of Edinburgh 4th ISM-ZIB-IMI MODAL Workshop Mathematical Optimization and Data Analysis Tokyo 27 March 2019 Overview LP background Serial simplex Interior point methods Solvers Parallel simplex For structured LP problems For general LP problems A novel method Julian Hall Linear Programming solvers: the state of the art 2 / 59 Solution of linear programming (LP) problems minimize f = cT x subject to Ax = b x 0 ≥ Background Example Fundamental model in optimal decision-making Solution techniques Simplex method (1947) ◦ Interior point methods (1984) ◦ Novel methods ◦ Large problems have 103{108 variables ◦ 103{108 constraints ◦ Matrix A is (usually) sparse STAIR: 356 rows, 467 columns and 3856 nonzeros Julian Hall Linear Programming solvers: the state of the art 3 / 59 Solving LP problems: Necessary and sufficient conditions for optimality minimize f = cT x subject to Ax = b x 0 ≥ Karush-Kuhn-Tucker (KKT) conditions x∗ is an optimal solution there exist y ∗ and s∗ such that () Ax = b (1) x 0 (3) xT s = 0 (5) ≥ AT y + s = c (2) s 0 (4) ≥ For the simplex algorithm (1{2 and 5) always hold Primal simplex algorithm: (3) holds and the algorithm seeks to satisfy (4) Dual simplex algorithm: (4) holds and the algorithm seeks to satisfy (3) For interior point methods (1{4) hold and the method seeks to satisfy (5) Julian Hall Linear Programming solvers: the state of the art 4 / 59 Solving LP problems: Characterizing the feasible region x3 minimize f = cT x subject to Ax = b x 0 ≥ x2 m×n A R is full rank 2 n Solution of Ax = b is a n m dim. hyperplane in R K − Intersection with x 0 is the feasible region K ≥ A vertex of K has m basic components, i given by Ax = b n m zero nonbasic components,2 B j − 2 N where partitions 1;:::; n B[N f g A solution of the LP occurs at a vertex of K x1 Julian Hall Linear Programming solvers: the state of the art 5 / 59 Solving LP problems: Optimality conditions at a vertex minimize f = cT x subject to Ax = b x 0 ≥ Karush-Kuhn-Tucker (KKT) conditions x∗ is an optimal solution there exist y ∗ and s∗ such that () Ax = b (1) x 0 (3) xT s = 0 (5) ≥ AT y + s = c (2) s 0 (4) ≥ x c s Given , partition A as BN , x as B , c as B and s as B B[N x N c N s N If x = 0 and x = b B−1b thenBx + Nx = b so Ax = b (1) N B ≡ B N For (2) If y = B−T c and s = 0 then BT y + s = c b B B B B T T B s B c B If s N = c N c N N y then (2) holds T y + = T ≡ −T T N s N c N Finally, x s = x s + x s = 0 (5) B B N N Need b b 0 for (3) and c 0 for (4) ≥ N ≥ Julian Hall Linear Programming solvers: the state of the art 6 / 59 b b Solving LP problems: Simplex and interior point methods Simplex method (1947) Interior point method (1984) Given so (1{2 and 5) hold Replace x 0 by log barrier B[N ≥ Primal simplex method Solve n ^ T Assume b 0 (3) maximize f = c x + µ ln(xj ) Force c^ ≥0 (4) N ≥ subject to Ax = b j=1 Dual simplex method X Assume c^ 0 (4) KKT (5) changes: N ≥ T Force b^ 0 (3) Replace x s = 0 by XS = µe ≥ X and S have x and s on diagonal Modify B[N KKT (1{4) hold Combinatorial approach Satisfy (5) by forcing XS = µe as Cost O(2n) iterations µ 0 Practically: O(m + n) iterations ! Iterative approach Practically: O(pn) iterations Julian Hall Linear Programming solvers: the state of the art 7 / 59 Simplex method The simplex algorithm: Definition x3 b x2 At a feasible vertex x = corresponding to 0 B[N 1 If c N 0 then stop: theb solution is optimal K ≥ 2 Scan cj < 0 for q to leave x b N x+αd −1 aq 3 Let aq = B Neq and d = − b eq b 4 Scanbbi =aiq > 0 for α and p to leave B 5 Exchange p and q between and b b B N x1 6 Go to 1 Julian Hall Linear Programming solvers: the state of the art 9 / 59 Primal simplex algorithm: Choose a column Assume b 0 Seek c 0 RHS ≥ N ≥ N Scan ci < 0 for q to leave b b N b B T cq cN b b Julian Hall Linear Programming solvers: the state of the art 10 / 59 Primal simplex algorithm: Choose a row Assume b 0 Seek c 0 RHS ≥ N ≥ N Scan cj < 0 for q to leave b b N aq b Scan bi =aiq > 0 for p to leave B b B a b bpq bp b b b b Julian Hall Linear Programming solvers: the state of the art 11 / 59 Primal simplex algorithm: Update cost and RHS Assume b 0 Seek c 0 RHS ≥ N ≥ N Scan cj < 0 for q to leave b b N aq b Scan bi =aiq > 0 for p to leave b B B T apq ap bbp Update:b Exchange p and q between and b b B N Update b := b α a α = b =a T b P q P p pq bcq cbN T −T T Update c N := c N + αD ap αD = cq=apq b b b− b b b b b b b b b Julian Hall Linear Programming solvers: the state of the art 12 / 59 Primal simplex algorithm: Data required Assume b 0 Seek c 0 RHS ≥ N ≥ N Scan cj < 0 for q to leave b b N aq b Scan bi =aiq > 0 for p to leave b B B T apq ap bbp Update:b Exchange p and q between and b b B N Update b := b α a α = b =a T b P q P p pq bcq cbN T −T T Update c N := c N + αD ap αD = cq=apq b b b− b b b b Data requiredb b b b b T T −1 Pivotal row ap = ep B N −1 Pivotal column aq = B aq b Julian Hall Linear Programming solvers: the state of the art 13 / 59 b Primal simplex algorithm Assume b 0 Seek c 0 RHS ≥ N ≥ N Scan cj < 0 for q to leave b b N aq b Scan bi =aiq > 0 for p to leave b B B T apq ap bbp Update:b Exchange p and q between and b b B N Update b := b α a α = b =a T b P q P p pq bcq cbN T −T T Update c N := c N + αD ap αD = cq=apq b b b− b b b b Data requiredb b b bWhyb does it work? Pivotal row aT = eT B−1N b c p p Objective improves by p q each iteration −1 × Pivotal column aq = B aq − apq b b b Julian Hall Linear Programming solvers: the state of the art 14 / 59 b b Why does it work? bp cq Objective improves by × each iteration − apq b b b Simplex method: Computation Standard simplex method (SSM): Major computational component 1 T RHS Update of tableau: N := N aqap N − apq where N = B−1N N b b b b b B Hopelessly inefficient for sparseb LP problems T b cbN b Prohibitively expensive for large LP problems Revised simplexb method (RSM): Major computational components T T T Pivotal row via B πp = ep BTRAN and ap = πp N PRICE −1 Pivotal column via B aq = aq FTRAN Represent B INVERT b −1 ¯ T Update B exploiting B = B + (aq Bep)ep UPDATE b − Julian Hall Linear Programming solvers: the state of the art 15 / 59 Serial simplex: Hyper-sparsity Serial simplex: Solve Bx = r for sparse r Given B = LU, solve Ly = r; Ux = y In revised simplex method, r is sparse: consequences? If B is irreducible then x is full If B is highly reducible then x can be sparse Phenomenon of hyper-sparsity Exploit it when forming x Exploit it when using x Julian Hall Linear Programming solvers: the state of the art 17 / 59 Serial simplex: Hyper-sparsity Inverse of a sparse matrix and solution of Bx = r Optimal B for LP problem stair B−1 has density of 58%, so B−1r is typically dense Julian Hall Linear Programming solvers: the state of the art 18 / 59 Serial simplex: Hyper-sparsity Inverse of a sparse matrix and solution of Bx = r Optimal B for LP problem pds-02 B−1 has density of 0.52%, so B−1r is typically sparse|when r is sparse Julian Hall Linear Programming solvers: the state of the art 19 / 59 Serial simplex: Hyper-sparsity Use solution of Lx = b To illustrate the phenomenon of hyper-sparsity To demonstrate how to exploit hyper-sparsity Apply principles to other triangular solves in the simplex method Julian Hall Linear Programming solvers: the state of the art 20 / 59 Serial simplex: Hyper-sparsity Recall: Solve Lx = b using function ftranL(L, b, x) r = b When b is sparse for all j 1;:::; m do Inefficient until r fills in 2 f g for all i : Lij = 0 do 6 ri = ri Lij rj x = r − Julian Hall Linear Programming solvers: the state of the art 21 / 59 Serial simplex: Hyper-sparsity Better: Check rj for zero When x is sparse function ftranL(L, b, x) r = b Few values of rj are nonzero for all j 1;:::; m do Check for zero dominates 2 f g if rj = 0 then Requires more efficient identification 6 for all i : Lij = 0 do of set of indices j such that rj = 0 6 X 6 ri = ri Lij rj x = r − Gilbert and Peierls (1988) H and McKinnon (1998{2005) Julian Hall Linear Programming solvers: the state of the art 22 / 59 Serial simplex: Hyper-sparsity Recall: major computational components −1 FTRAN: Form aq = B aq −T BTRAN: Form πp = B ep bT T PRICE: Form ap = πp N b −T T T BTRAN: Form πp = B ep PRICE: Form ap = πp N Transposed triangular solves T Hyper-sparsity: πp is sparse T T b L x = b has xi = bi l i x Store N row-wise T− Hyper-sparsity: l i x typically zero T Form ap as a combination of Also store L (and U) row-wise and T use FTRAN code rows of N for nonzeros in πp b H and McKinnon (1998{2005) COAP best paper prize (2005) Julian Hall Linear Programming solvers: the state of the art 23 / 59 Interior point methods Interior point methods: Traditional Replace x 0 by log barrier function and solve ≥ n T maximize f = c x + µ ln(xj ) such that Ax = b j=1 X For small µ this has the same solution as the LP Solve for a decreasing sequence of values of µ, moving through interior of K Perform a small number of (expensive) iterations: each solves Θ−1 AT ∆x f − = G∆y = h A 0 ∆y d () where ∆x and ∆y are steps in the primal and dual variables and G = AΘAT Standard technique is to form the Cholesky decomposition G = LLT and perform triangular solves with L Julian Hall Linear Programming solvers: the state of the art 25 / 59 Interior point methods: Traditional Forming the Cholesky decomposition G = LLT and perform triangular solves with L T T G = AΘA = θj aj aj is generally sparse j So long as denseX columns of A are treated carefully Much effort has gone into developing efficient serial Cholesky