Three High Performance Simplex Solvers
Total Page:16
File Type:pdf, Size:1020Kb
Three high performance simplex solvers Julian Hall1 Qi Huangfu2 Ivet Galabova1 Others 1School of Mathematics, University of Edinburgh 2FICO Argonne National Laboratory 16 May 2017 Overview Background Dual vs primal simplex method Three high performance simplex solvers EMSOL (1992{2004) PIPS-S (2011{date) hsol (2011{date) The future Julian Hall, Qi Huangfu, Ivet Galabova et al. Three high performance simplex solvers 2 / 37 Solving LP problems: Characterizing a basis minimize f = cT x x3 subject to Ax = b x 0 ≥ x2 n A vertex of the feasible region K R has ⊂ m basic components, i given by Ax = b 2 B K n m zero nonbasic components, j − 2 N where partitions 1;:::; n B[N f g Equations partitioned according to as B[N Bx B + Nx N = b with nonsingular basis matrix B x1 Solution set of Ax = b characterized by x = b B−1Nx B − N where b = B−1b b Julian Hall, Qi Huangfu, Ivet Galabova et al. Three high performance simplex solvers 3 / 37 b Solving LP problems: Optimality conditions minimize f = cT x x3 subject to Ax = b x 0 ≥ x2 Objective partitioned according to as B[N f = cT x + cT x K B B N N T = f + c N x N T T T T −1 where f = c B b and c N = c N c B B N is the vector of reduced costs b b − b b Partition yields an optimalb solution if there is Primal feasibility b 0 Dual feasibility c ≥0 x1 N ≥ b b Julian Hall, Qi Huangfu, Ivet Galabova et al. Three high performance simplex solvers 4 / 37 Primal simplex algorithm Assume b 0 Seek c 0 RHS ≥ N ≥ N Scan cj for q to leave b bN 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 Whyb 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, Qi Huangfu, Ivet Galabova et al. Three high performance simplex solvers 5 / 37 b b Dual simplex algorithm Assume c 0 Seek b 0 RHS N ≥ ≥ N Scan bi < 0 for p to leave b b B b Scan cj =apj for q to leave b N B bbp b b b Julian Hall, Qi Huangfu, Ivet Galabova et al. Three high performance simplex solvers 6 / 37 Dual simplex algorithm Assume c 0 Seek b 0 RHS N ≥ ≥ N Scan bi < 0 for p to leave b b B Scan cj =apj for q to leave b N B T apq ap b b T bcq cbN b b Julian Hall, Qi Huangfu, Ivet Galabova et al. Three high performance simplex solvers 7 / 37 Dual simplex algorithm Assume c 0 Seek b 0 RHS N ≥ ≥ N Scan bi < 0 for p to leave b b B aq b Scan cj =apj for q to leave b N B T apq ap bp Update: Exchange p and q between and b b 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 Whyb 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, Qi Huangfu, Ivet Galabova et al. Three high performance simplex solvers 8 / 37 b b Simplex method: Computation Standard simplex method (SSM): Major computational component RHS 1 T N Update of tableau: N := N aqap − apq N b B Hopelessly inefficientb b for sparseb b LP problems T Prohibitively expensive forb large LP problems cbN b Revised simplexb method (RSM): Major computational components T T T Pivotal row via B πp = ep BTRAN and ap = πp N PRICE Pivotal column via B aq = aq FTRAN Invert B b b Julian Hall, Qi Huangfu, Ivet Galabova et al. Three high performance simplex solvers 9 / 37 Simplex algorithm: Primal or dual? Primal simplex algorithm Traditional variant Solution is generally not primal feasible when LP is tightened Dual simplex algorithm Preferred variant Easier to get dual feasibility More progress in many iterations Solution is dual feasible when LP is tightened Julian Hall, Qi Huangfu, Ivet Galabova et al. Three high performance simplex solvers 10 / 37 EMSOL (1992{2004) Overview Written in FORTRAN to study parallel simplex Primal simplex T Product form update for B := B + (aq Bep)e − p simple and easy to parallelize inefficient and numerically unstable Output: Parallel codes ASYNPLEX and PARSMI developed for Cray T3D Slave processors send attractive tableau columns to a master processor which keeps them up-to-date and determines basis changes Modest speed-up on general sparse LP problems Non-deterministic H and McKinnon (1995{1998) Julian Hall, Qi Huangfu, Ivet Galabova et al. Three high performance simplex solvers 11 / 37 EMSOL: Theoretical and serial outputs Output: Simplest LPs which cycle Each simplex iteration improves the objective by bp×cbq − abpq Termination guaranteed if all bp > 0 Cycling can occur if some bp = 0 (degeneracy) Found the family of (provably) simplestb LPs which cycle, even with the leading b practical anti-degeneracy technique H and McKinnon (1996{2004) Output: Hyper-sparsity Solution of Bx = r is x = B−1r In the simplex method, B and r are sparse For some LPs x is typically sparse: hyper-sparsity Remarkable? Julian Hall, Qi Huangfu, Ivet Galabova et al. Three high performance simplex solvers 12 / 37 EMSOL 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, Qi Huangfu, Ivet Galabova et al. Three high performance simplex solvers 13 / 37 EMSOL 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 Julian Hall, Qi Huangfu, Ivet Galabova et al. Three high performance simplex solvers 14 / 37 EMSOL: Exploiting hyper-sparsity do k = 1, K To solve Bx = r Using decomposition of B given by rpk := rpk /µk K pk ; µk ; ηk k=1 r := r rp η f g − k k Traditional technique transforms RHS into solution x end do When initial RHS is sparse: inefficient until r fills in Julian Hall, Qi Huangfu, Ivet Galabova et al. Three high performance simplex solvers 15 / 37 EMSOL: Exploiting hyper-sparsity do k = 1, K To solve Bx = r if (rpk .ne. 0) then Using decomposition of B given by rpk := rpk /µk K pk ; µk ; ηk k=1 r := r rp η f g − k k end if When r is sparse skip ηk if rpk is zero end do When x is sparse, the dominant cost is the test for zero Requires efficient identification of vectors ηk to be applied Gilbert and Peierls (1988) H and McKinnon (1998{2005) COAP best paper prize (2005) Julian Hall, Qi Huangfu, Ivet Galabova et al. Three high performance simplex solvers 16 / 37 PIPS-S (2011{date) Overview Written in C++ to solve stochastic MIP relaxations in parallel Dual simplex Based on NLA routines in clp Product form update Concept Exploit data parallelism due to block structure of LPs Distribute problem over processes Paper: Lubin, H, Petra and Anitescu (2013) COIN-OR INFORMS 2013 Cup COAP best paper prize (2013) Julian Hall, Qi Huangfu, Ivet Galabova et al. Three high performance simplex solvers 17 / 37 PIPS-S: Stochastic MIP problems Two-stage stochastic LPs have column-linked block angular (BALP) structure T T T T minimize c0 x 0 + c1 x 1 + c2 x 2 + ::: + cN x N subject to Ax 0 = b0 T1x 0 + W1x 1 = b1 T2x 0 + W2x 2 = b2 . .. TN x 0 + WN x N = bN x 0 0 x 1 0 x 2 0 ::: x N 0 ≥ ≥ ≥ ≥ n Variables x0 R 0 are first stage decisions 2 n Variables xi R i for i = 1;:::; N are second stage decisions Each corresponds2 to a scenario which occurs with modelled probability The objective is the expected cost of the decisions In stochastic MIP problems, some/all decisions are discrete Julian Hall, Qi Huangfu, Ivet Galabova et al. Three high performance simplex solvers 18 / 37 PIPS-S: Stochastic MIP problems Power systems optimization project at Argonne Integer second-stage decisions Stochasticity from wind generation Solution via branch-and-bound Solve root using parallel IPM solver PIPS Lubin, Petra et al. (2011) Solve nodes using parallel dual simplex solver PIPS-S Julian Hall, Qi Huangfu, Ivet Galabova et al. Three high performance simplex solvers 19 / 37 PIPS-S: Stochastic MIP problems Convenient to permute the LP thus: T T T T minimize c1 x 1 + c2 x 2 + ::: + cN x N + c0 x 0 subject to W1x 1 + T1x 0 = b1 W2x 2 + T2x 0 = b2 . .. WN x N + TN x 0 = bN Ax 0 = b0 x 1 0 x 2 0 ::: x N 0 x 0 0 ≥ ≥ ≥ ≥ Julian Hall, Qi Huangfu, Ivet Galabova et al.