Revised Simplex Algorithm - 1
Total Page:16
File Type:pdf, Size:1020Kb
Lecture 9: Linear Programming: Revised Simplex and Interior Point Methods (a nice application of what we have learned so far) Prof. Krishna R. Pattipati Dept. of Electrical and Computer Engineering University of Connecticut Contact: [email protected] (860) 486-2890 ECE 6435 Fall 2008 Adv Numerical Methods in Sci Comp October 22, 2008 Copyright ©2004 by K. Pattipati Lecture Outline What is Linear Programming (LP)? Why do we need to solve Linear-Programming problems? • L1 and L∞ curve fitting (i.e., parameter estimation using 1-and ∞-norms) • Sample LP applications • Transportation Problems, Shortest Path Problems, Optimal Control, Diet Problem Methods for solving LP problems • Revised Simplex method • Ellipsoid method….not practical • Karmarkar’s projective scaling (interior point method) Implementation issues of the Least-Squares subproblem of Karmarkar’s method ….. More in Linear Programming and Network Flows course Comparison of Simplex and projective methods References 1. Dimitris Bertsimas and John N. Tsisiklis, Introduction to Linear Optimization, Athena Scientific, Belmont, MA, 1997. 2. I. Adler, M. G. C. Resende, G. Vega, and N. Karmarkar, “An Implementation of Karmarkar’s Algorithm for Linear Programming,” Mathematical Programming, Vol. 44, 1989, pp. 297-335. 3. I. Adler, N. Karmarkar, M. G. C. Resende, and G. Vega, “Data Structures and Programming Techniques for the Implementation of Karmarkar’s Algorithm,” ORSA Journal on Computing, Vol. 1, No. 2, 1989. 2 Copyright ©2004 by K. Pattipati What is Linear Programming? One of the most celebrated problems since 1951 • Major breakthroughs: • Dantzig: Simplex method (1947-1949) • Khachian: Ellipsoid method (1979) - Polynomial complexity, but not competitive with the Simplex → not practical. • Karmarkar: Projective Interior point algorithm (1984) - Polynomial complexity and competitive (especially for large problems) LP Problem Definition Given: an m x n matrix A, m n or A Rmn , m n assume rank( A) m a column vector b with m components: b Rm a row vector cTn with n components: c R n m x n Ax b has infinitely many solutions b aii x i1 T consider xRAr , Axb r Axx r n b, where xNA n ( ) xAx n: n 0 3 Copyright ©2004 by K. Pattipati Standard form of LP We impose two restrictions on x : We want nonnegative solutions of Ax b xi 0 (or) x 0 x such that Ax b & x0 are said to be feasible Among all those feasible {xx }, we want * such that T c x c1 x 1 c 2 x 2 ... cnn x is a minimum • This leads to the so-called “standard form of LP” min cxT convex programming problem. If a * (SLP): s.t. Ax b bounded solution exists, then x is x 0 unique a single minimum. • Claim: Any LP problem can be converted into standard form. Inequality constraints: TTx a) ai x b i a i1 b i ; x n11 0, x n slack variable xn1 Aa x In general: AxbAxyb AI bx, 0, y 0 y Increase number of variables by m & Aa is m by ( n m ) matrix. 4 Copyright ©2004 by K. Pattipati How to Convert Constraints into a SLP? - 1 Inequality Constraints TT b) ai x b i a i x x n1 b i, x n 1 0; x n 1 ~ surplus variable x Ax b A I b, y 0 y c) di x i define xˆˆ i x i d i & x i 0 d) di x i define xˆˆ i d i x i & x i 0 e) di1 x i d i 2 0 x i d i 1 d i 2 d i 1 define xˆˆ x d and x y d d; y 0 i i i1 i i i 2 i 1 i slack T f) b12i a i x b i use two slacks T ai x y i11 b i yy, 0 T ii12 ai x y i22 b i TTTT g) axbi i baxb i i i axy i i1 bax i; i ybii2 5 Copyright ©2004 by K. Pattipati How to Convert Constraints into a SLP? - 2 xi is a free variable Define xi x i xˆˆ i with x i 0 & x i 0 a) Maximization: change cTT x to c x n ˆ b) min xi s.t. Axb Axyb ; write xxx i i i i1 n ˆ min xxii i1 The optimal solution of x this problem solves the s.t. A A I xˆ b original problem. y Example of LP Problems • L1 – curve fitting Recall that given a set of scalars b12, b,..., bm , the estimate that m minimizes xb i is the median and that this estimate is insensitive i1 to outliers in the data {.bi} 6 Copyright ©2004 by K. Pattipati Curve Fitting In the vector case, we want x such that: m T minaii x b min Ax b xx 1 i1 • L1 – curve fitting → an LP T write x x xˆ; ai x b i u i v i ; n T Then the LP problem is: minuii v min e u v x,,,, u v x u v i1 s.t. A x xˆ u v b xx 0; ˆ 0; uv0; 0 T • L – curve fitting want x such that min max aii x b min Ax b ∞ xx1im • L∞ – curve fitting → an LP T Let maxaii x b w ; then the problem is equivalent to: 1im T minw , s.t. w aii x b w for i 1,2,..., m xw, A e x b minw s.t. A e w b 7 Copyright ©2004 by K. Pattipati Transportation Problem - 1 • Since the number of constraints is large (2m) and the number of variables (n) is small, typically the dual problem with (n+1) constraints and 2m variables is solved instead. maxbT s.t. AeTT 0, =1 and 0; 0 Transportation or Hitchcock problem (special LP) mn sources of a commodity or a product and destinations amount of commodity to be shipped from source i ai , 1 i m amount of commodity to be received at destination (sink, terminal node) i bj , 1 j n shipping cost from source ij to destination per unit commodity cij dollars/unit − Problem: How much commodity to be shipped from source i to destination j to minimize the total cost of transportation? 8 Copyright ©2004 by K. Pattipati Transportation Problem - 2 c11, x11 i = 1 j = 1 c21, x21 mn c , x m1 m1 min axij ij x ij ij11 c12, x12 n c , x s.t. x a i 1,2,..., m 22 22 j = 2 ij i i = 2 j1 m cm2, xm2 xij b j j 1,2,..., n c , x i1 1n 1n mn c2n, x2n Also: abij i = m j = m ij11 cmn, xmn Conservation Constraint: m sources: n terminal nodes: sinks, mn variables & ( m n ) constraints supply nodes destination nodes BIPARTITE GRAPHS: Special LP Problem abii 1 Assignment problem or weighted bipartite matching problem. 9 Copyright ©2004 by K. Pattipati Shortest Path Problem - 1 Shortest-path problem • We formulate it as an LP for conceptual reasons only u - s, u, v, t are computers, edge lengths 2 5 are costs of sending a message between pairs of nodes denoting computers 1 s t - Q: What is the cheapest way to source send a message from s to t? 4 v 3 Intuitively, xxsv ut 0, i.e., no messages are sent from s to v & from u to t. Shortest path s- u - v - t xsu x uv x vt 1 Shortest path length = 2 1 3 6 10 Copyright ©2004 by K. Pattipati Shortest Path Problem - 2 LP problem formulation Let xij be the fraction of messages sent from i to j min 2xsu 4 x sv x uv 5 x ut 3 x vt s.t. xsu0; x sv 0; x uv 0; x ut 0; x vt 0 xsu x uv x ut 0 (message not lost at u) xsv x uv x vt 0 xxut vt 1 • Add all constraints xsu + xsv = 1, which it must be!! • Only 3 independent constraints (although 4 nodes) In matrix notation: xsu 1 0 1 1 0x 0 sv Ax0 1 1 0 1 xuv 0 b 0 0 0 1 1 xut 1 xvt nn nodes 1 independent equations Similar to Kirchoff's Laws 11 Copyright ©2004 by K. Pattipati Optimal Control Problem - 1 Shortest path problem as a standard LP NOTE: min exT - A is called the incidence matrix s.t. Ax b - b is a special vector - AAA is a unimodular matrix and so are all invertible submatrices of x 0 detA 1 or 1 Optimal Control • Consider a linear time-invariant discrete-time system xk1 Ax k bu k; u k ~ scalar for simplicity, k 0,1,.... k 1 kk1 xkl A x0 A bu /0 N 1 N N l 1 Define Terminal Error: eN x d x N x d A x0 A bu l /0 Given x0, xdk & given the fact that u is constrained by u minuuk max , we can formulate various versions of LP. 12 Copyright ©2004 by K. Pattipati Optimal Control Problem - 2 Versions of LP n n N 1 a) mine x AN x A N l 1 bu 1-norm of error Ni d0 i l i1 i 1 l 0 i n T cii d z i1 Nl1 d N vector with components A b d i i il T z u0, u 1 ,..., uN 1 s.t. uzmin 1 umax 1 T Convert to standard form via: vi u i c i d i z n Optimal Solutions: vuii TT i1 * di z c i if d i z c i 0 vi 0 otherwise s.t.