Hon Wai Leong, NUS (CS6234, Spring 2009) Page 1 Copyright © 2009 by Leong Hon Wai CS6234: Lecture 4  Linear Programming  LP and Simplex Algorithm [PS82]-Ch2.

Slides:



Advertisements
Similar presentations
February 14, 2002 Putting Linear Programs into standard form
Advertisements

1 Outline relationship among topics secrets LP with upper bounds by Simplex method basic feasible solution (BFS) by Simplex method for bounded variables.
Duality for linear programming. Illustration of the notion Consider an enterprise producing r items: f k = demand for the item k =1,…, r using s components:
Geometry and Theory of LP Standard (Inequality) Primal Problem: Dual Problem:
ECE Longest Path dual 1 ECE 665 Spring 2005 ECE 665 Spring 2005 Computer Algorithms with Applications to VLSI CAD Linear Programming Duality – Longest.
Linear Programming (LP) (Chap.29)
C&O 355 Mathematical Programming Fall 2010 Lecture 22 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A.
Introduction to Algorithms
1 Introduction to Linear Programming. 2 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. X1X2X3X4X1X2X3X4.
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc
The Simplex Method and Linear Programming Duality Ashish Goel Department of Management Science and Engineering Stanford University Stanford, CA 94305,
Basic Feasible Solutions: Recap MS&E 211. WILL FOLLOW A CELEBRATED INTELLECTUAL TEACHING TRADITION.
Linear programming Thomas S. Ferguson University of California at Los Angeles Compressive Sensing Tutorial PART 3 Svetlana Avramov-Zamurovic January 29,
Computational Methods for Management and Economics Carla Gomes
7(2) THE DUAL THEOREMS Primal ProblemDual Problem b is not assumed to be non-negative.
MIT and James Orlin © Chapter 3. The simplex algorithm Putting Linear Programs into standard form Introduction to Simplex Algorithm.
Hon Wai Leong, NUS (CS6234, Spring 2009) Page 1 Copyright © 2009 by Leong Hon Wai CS6234 Lecture 1 -- (14-Jan-09) “Introduction”  Combinatorial Optimization.
Algorithms CISC 4080/CISC 5825 Linear Programming, Simplex Method and Duality Theory Dr Kamesam Graduate School Of Business Fordham University.
C&O 355 Mathematical Programming Fall 2010 Lecture 4 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A.
Simplex method (algebraic interpretation)
Duality Theory LI Xiaolei.
Chapter 3. Pitfalls Initialization Ambiguity in an iteration
1 1 Slide © 2000 South-Western College Publishing/ITP Slides Prepared by JOHN LOUCKS.
Kerimcan OzcanMNGT 379 Operations Research1 Linear Programming: The Simplex Method Chapter 5.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
Pareto Linear Programming The Problem: P-opt Cx s.t Ax ≤ b x ≥ 0 where C is a kxn matrix so that Cx = (c (1) x, c (2) x,..., c (k) x) where c.
C&O 355 Mathematical Programming Fall 2010 Lecture 18 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A.
TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A A A A A A A A Image:
Linear Programming Revised Simplex Method, Duality of LP problems and Sensitivity analysis D Nagesh Kumar, IISc Optimization Methods: M3L5.
Chapter 6 Linear Programming: The Simplex Method Section 3 The Dual Problem: Minimization with Problem Constraints of the Form ≥
Hon Wai Leong, NUS (CS6234, Spring 2009) Page 1 Copyright © 2009 by Leong Hon Wai CS6234: Lecture 4  Linear Programming  LP and Simplex Algorithm [PS82]-Ch2.
Advanced Operations Research Models Instructor: Dr. A. Seifi Teaching Assistant: Golbarg Kazemi 1.
Discrete Optimization Lecture #3 2008/3/41Shi-Chung Chang, NTUEE, GIIE, GICE Last Time 1.Algorithms and Complexity » Problems, algorithms, and complexity.
1 1 Slide © 2005 Thomson/South-Western Linear Programming: The Simplex Method n An Overview of the Simplex Method n Standard Form n Tableau Form n Setting.
Chapter 4 Linear Programming: The Simplex Method
Linear Program Set Cover. Given a universe U of n elements, a collection of subsets of U, S = {S 1,…, S k }, and a cost function c: S → Q +. Find a minimum.
C&O 355 Mathematical Programming Fall 2010 Lecture 5 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A A.
1 THE REVISED SIMPLEX METHOD CONTENTS Linear Program in the Matrix Notation Basic Feasible Solution in Matrix Notation Revised Simplex Method in Matrix.
OR Chapter 8. General LP Problems Converting other forms to general LP problem : min c’x  - max (-c)’x   = by adding a nonnegative slack variable.
C&O 355 Lecture 7 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A.
CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.
OR Chapter 7. The Revised Simplex Method  Recall Theorem 3.1, same basis  same dictionary Entire dictionary can be constructed as long as we.
1 Introduction to Linear Programming. 2 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. X1X2X3X4X1X2X3X4.
OR Relation between (P) & (D). OR optimal solution InfeasibleUnbounded Optimal solution OXX Infeasible X( O )O Unbounded XOX (D) (P)
Hon Wai Leong, NUS (CS6234, Spring 2009) Page 1 Copyright © 2009 by Leong Hon Wai CS6234: Lecture 4  Linear Programming  LP and Simplex Algorithm [PS82]-Ch2.
C&O 355 Lecture 19 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A A A A A.
Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc. Linear Programming: An Algebraic Approach 4 The Simplex Method with Standard Maximization.
Linear Programming Chap 2. The Geometry of LP  In the text, polyhedron is defined as P = { x  R n : Ax  b }. So some of our earlier results should.
Approximation Algorithms Duality My T. UF.
EMGT 6412/MATH 6665 Mathematical Programming Spring 2016
Lap Chi Lau we will only use slides 4 to 19
The Duality Theorem Primal P: Maximize
Chap 10. Sensitivity Analysis
Topics in Algorithms Lap Chi Lau.
The minimum cost flow problem
Perturbation method, lexicographic method
Duality for linear programming.
Chapter 4 Linear Programming: The Simplex Method
Chap 9. General LP problems: Duality and Infeasibility
The Simplex Method: Standard Minimization Problems
Chapter 5. Sensitivity Analysis
Analysis of Algorithms
Chapter 4. Duality Theory
Chapter 8. General LP Problems
Lecture 4 Part I Mohamed A. M. A..
Chapter 5. The Duality Theorem
Flow Feasibility Problems
Chapter 8. General LP Problems
Prepared by Po-Chuan on 2016/05/24
Presentation transcript:

Hon Wai Leong, NUS (CS6234, Spring 2009) Page 1 Copyright © 2009 by Leong Hon Wai CS6234: Lecture 4  Linear Programming  LP and Simplex Algorithm [PS82]-Ch2  Duality [PS82]-Ch3  Primal-Dual Algorithm [PS82]-Ch5  Additional topics: uReading/Presentation by students Lecture notes adapted from Comb Opt course by Jorisk, Math Dept, Maashricht Univ,

12/25/2015Combinatorial Optimization Masters OR Combinatorial Optimization Chapter 3 of [PS82] Duality

12/25/2015Combinatorial Optimization Masters OR LP in general form min c´ x s.t. a´ i x= b i i ε M a´ i x ≤ b i i ε M´ x j ≥0j ε N x j freej ε N´ 1.Introduce surplus variables for inequality constraints 2.Replace free variables by two non-negative variables.

12/25/2015Combinatorial Optimization Masters OR In standard form… minc ~ ´ x ~ s.t.A ~ x ~ = b x ~ ≥ 0 where A ~ has extra columns for x´s in N´, and for slack variables, x ~ has extra variables for x´s in N´ and for slack variables, c ~ has extra elements for x´s in N´.

12/25/2015Combinatorial Optimization Masters OR Starting the dual The simplex method gives an optimal solution x 0 ~ to the LP in standard form, with a basis Q, satisfying c ~ ´ – (c B ~ ´ B ~-1 )A ~ ≥ 0. Thus, π ´ = c B ~ ´ B ~-1 is a feasible solution to the problem π ´ A ~ ≤ c ~ ´ where π ε R m.

12/25/2015Combinatorial Optimization Masters OR The dual 1.π´ A j ≤ c j, for j ε N, 2.π´ A j ≤ c j, for j ε N´, and π´ A j ≤ –c j, for j ε N´, and hence π´ A j = c j, for j ε N´. 3.–π i ≤ 0, for i ε M´, or π i ≥ 0, for i ε M´. Objective: max π´ b.

12/25/2015Combinatorial Optimization Masters OR Definition of the Dual Definition 3.1: Given an LP in general form, called the primal, the dual is defined as follows PrimalDual Min c ´ xMax π ´ b a ´ i x = b i i ε M π i free a ´ i x ≥ b i i ε M ´ π i ≥ 0 x j ≥ 0 j ε N π ´ A j ≤ c j x j free j ε N ’ π ´ A j = c j

12/25/2015Combinatorial Optimization Masters OR Strong duality Theorem 3.1: If an LP has an optimal solution, so does its dual, and at optimality their costs are equal. Proof. Let x and π be optimal solutions to the primal and the dual resp., then c ´ x ≥ π ´ Ax ≥ π ´ b. (*) From the dual From the primal

12/25/2015Combinatorial Optimization Masters OR Strong duality proof Thus the primal has cost at least as high as the dual. Then, if the primal has a feasible solution, the cost of the dual cannot be unbounded. It has feasible solution π´, and since it is not unbounded, it must have an optimum. The cost of π´ is π´ b = c B ~ ´ B ~-1 b = c B ~ ´ x 0 ~ which is the optimal solution of the primal. Together with (*) this suffices to prove the Theorem.

12/25/2015Combinatorial Optimization Masters OR The dual of the dual Theorem 3.2. The dual of the dual is the primal. Proof. Left as an exercise. Theorem 3.3: Given a primal-dual pair, either of the following holds: 1.Both have a finite optimum 2.Both are infeasible 3.One is unbounded the other is infeasible Proof. Skip.

12/25/2015Combinatorial Optimization Masters OR Complementary slackness Theorem 3.4: A pair, x, π, respectively feasible in a primal-dual pair is optimal if and only if: u i = π i (a´ i x - b i ) = 0 for all i (1) v j = (c j - π´ A j ) x j = 0 for all j. (2)

12/25/2015Combinatorial Optimization Masters OR Complementary slackness (2) Proof: Recall u i = π i (a´ i x - b i ) & v j = (c j - π´A j ) x j Define u =  u i (≥ 0) & v =  v j (≥ 0) Thus, u = 0 if and only if (1) holds (each u i = 0) and v = 0 if and only if (2) holds (each v j = 0). Now, notice that (u + v) = c´x – π´b. Thus, if (1) and (2) hold, (u + v) = 0, and c´x = π´b. This implies that x and π have the same objective value, and hence are both optimal.

12/25/2015Combinatorial Optimization Masters OR Complementary slackness (3) Consequences: If an inequality constraint in the dual is not binding, then the corresponding primal variable must have value zero and vice versa. Likewise, if a nonnegative variable has strictly positive value, then the corresponding constraint must be binding.

12/25/2015Combinatorial Optimization Masters OR Tableau (for example 2.6) Min Z = x 1 + x 2 + x 3 + x 4 + x 5 s.t. 3x 1 + 2x 2 +x 3 = 1 5x 1 + 2x 2 + x 3 + x 4 = 3 2 x x 2 + x 3 + x 5 = 4 x1x1 x2x2 x3x3 x4x4 x5x5 – z

12/25/2015Combinatorial Optimization Masters OR Simplex Algorithm (Tableau Form) x1x1 x2x2 x3x3 x4x4 x5x5 –z–z x1x1 x2x2 x3x3 x4x4 x5x5 –z–z x3=x3= x4=x4=22010 x5=x5= x1x1 x2x2 x3x3 x4x4 x5x5 –z–z x3=x3= x4=x4= x5=x5= Diagonalize to get bfs { x 3, x 4, x 5 } Determine reduced cost by making c ~ j = 0 for all basic col

12/25/2015Combinatorial Optimization Masters OR

12/25/2015Combinatorial Optimization Masters OR Farkas Lemma Skip 3.3

12/25/2015Combinatorial Optimization Masters OR The shortest path problem and its dual Definition 3.3 Given a directed graph G=(V,E) and a nonnegative weight c j ≥ 0 associated with each arc e j ε E, an instance of the shortest path problem (SP) is the problem of finding a directed path from a distinguished source node s to a distinguished terminal node t, with the minimum total weight.

12/25/2015Combinatorial Optimization Masters OR Shortest path problem Feasible set F is given by F = {P = (e j 1,..,e j k ) : P is a directed path from s to t in G}. Cost c(P) = Σ i=1 k c j i. Formulation as LP uses node-arc incidence matrix A: 1if arc j leaves node i a ij = {-1-f arc j enters node i 0otherwise

12/25/2015Combinatorial Optimization Masters OR SP Example s a b t e1e1 e2e2 e3e3 e4e4 e5e5 e1e1 e2e2 e3e3 e4e4 e5e5 s11000 A=t000 a 0110 b0 01

12/25/2015Combinatorial Optimization Masters OR LP formulation Mine 1 +2e 2 +2e 3 +3e 4 + e 5 s.t. e 1 + e 2 = 1 - e 4 - e 5 = -1 - e 1 e 3 + e 4 = 0 - e 2 - e 3 + e 5 = 0 0 ≤ e i ≤ 1, i =1…5

12/25/2015Combinatorial Optimization Masters OR Redundancy Claim: Any solution that satisfies 3 of the four constraints, satisfies all 4 of them. Easily checked. Thus, we omit the constraint for the sink t. Next, we consider the tableau of a feasible solution

12/25/2015Combinatorial Optimization Masters OR Starting Tableau e1e1 e2e2 e3e3 e4e4 e5e5 -z s a00110 b s a b t e1e1 e2e2 e3e3 e4e4 e5e5

12/25/2015Combinatorial Optimization Masters OR Summary of LP for SP Simplex algorithm in tableau form –Cost vector c is also included as a constraint (Read details in [PS82]-Ch-2) Each basis has (n-1) edges; –Not all are positive; –Edges with +ve flows are on the (s-t) path Pivoting – bring in a new edge; –Based on relative cost (row0 of tableau) Clever idea!

12/25/2015Combinatorial Optimization Masters OR Starting Tableau e1e1 e2e2 e3e3 e4e4 e5e5 -z s a00110 b s a b t e1e1 e2e2 e3e3 e4e4 e5e5 To prepare basis { e 1, e 4, e 5 }: row2  row2 + row1;

12/25/2015Combinatorial Optimization Masters OR Initial feasible bfs (1) e1e1 e2e2 e3e3 e4e4 e5e5 -z s a b00 01 Basis { e 1, e 4, e 5 }: e 1 =1, e 4 =1, e 5 =0, this bfs is degenerate Now, to adjust reduced costs; First, row-0  row-0 - row-1 After we have row-2  row-1 + row-2; s a b t e1e1 e2e2 e3e3 e4e4 e5e5

12/25/2015Combinatorial Optimization Masters OR Initial feasible bfs (2) e1e1 e2e2 e3e3 e4e4 e5e5 -z01231 s a b00 01 After we have row 2  row 1 + row 2; After, row 0  row 0 - row 1; Then, row-0  row-0 – 3*(row-2); s a b t e1e1 e2e2 e3e3 e4e4 e5e5

12/25/2015Combinatorial Optimization Masters OR Initial feasible bfs (3) e1e1 e2e2 e3e3 e4e4 e5e5 -z s a b00 01 After we have row 2  row 1 + row 2; Then, row 0  row 0 + row 1; Then, row 0  row 0 – 3*(row 2); Then, row-0  row-0 – row-3; s a b t e1e1 e2e2 e3e3 e4e4 e5e5

12/25/2015Combinatorial Optimization Masters OR Initial feasible bfs (4) e1e1 e2e2 e3e3 e4e4 e5e5 -z s a b00 01 After we have row 2  row 1 + row 2; Then, row 0  row 0 + row 1; Then, row 0  row 0 – 3*(row 2); Then, row 0  row 0 + *(row 3) Basis { e 1, e 4, e 5 }: e 1 =1, e 4 =1, e 5 =0, this bfs is degenerate s a b t e1e1 e2e2 e3e3 e4e4 e5e5

12/25/2015Combinatorial Optimization Masters OR Pivoting (1) e1e1 e2e2 e3e3 e4e4 e5e5 -z s a b00 01 Choose col with -ve relative-cost; (bring col e 2 into the basis) Choose pivot from that column; Now, perform: (a) row1  row1 – row2; (b) row3  row3 + row1; s a b t e1e1 e2e2 e3e3 e4e4 e5e5

12/25/2015Combinatorial Optimization Masters OR Pivoting (2) e1e1 e2e2 e3e3 e4e4 e5e5 -z s010 0 a b Now, to bring e 2 into the basis; After (a) and (b); Now, get reduced cost: (c) row0  row0 + row2; s a b t e1e1 e2e2 e3e3 e4e4 e5e5

12/25/2015Combinatorial Optimization Masters OR Pivoting (3) e1e1 e2e2 e3e3 e4e4 e5e5 -z s010 0 a b Now, to bring e 2 into the basis; After (a) and (b); And (c); This solution is optimal. All relative cost (row0) are positive! s a b t e1e1 e2e2 e3e3 e4e4 e5e5

12/25/2015Combinatorial Optimization Masters OR The dual of SP Max π s – π t s.t. π ´ A ≤ c ´. π free. In case of SP: the constraints of the dual are: π i – π j ≤ c ij s a b t e1e1 e2e2 e3e3 e4e4 e5e5

12/25/2015Combinatorial Optimization Masters OR Complementary slackness for SP A path f as defined by primal variables, and an assignment of dual variables π are jointly optimal if and only if: 1.A primal variable with positive value corresponds to a dual constraint that is satisfied at equality. 2.A dual constraint not satisfied at equality corresponds to a primal variable with value zero.

12/25/2015Combinatorial Optimization Masters OR Min e 1 + 2e 2 + 2e 3 + 3e 4 + e 5 s.t. e 1 + e 2 = 1 - e 4 - e 5 = -1 - e 1 + e 3 + e 4 = 0 - e 2 - e 3 + e 5 = 0 0 ≤ e i ≤ 1, for i =1…5 Min π s – π t s.t. π s - π a  1 π s - π b  2 π a - π b  2 π a - π t  3 π b - π t  1 each π i  s a b t e1e1 e2e2 e3e3 e4e4 e5e5 3 1 ? s a b t e1e1 e2e2 e3e3 e4e4 e5e5 Compare dual variables π with label used in Dijkstra algorithm for shortest path!

12/25/2015Combinatorial Optimization Masters OR Read up the following sections on your own. Sect 3.5: Dual Info in the Tableau Sect 3.6: Dual Simplex Algorithm Sect 3.7: Intrepretation of Dual Simplex Algorithm

12/25/2015Combinatorial Optimization Masters OR Some Suggested Exercises: All from [PS82] Theorem

Hon Wai Leong, NUS (CS6234, Spring 2009) Page 38 Copyright © 2009 by Leong Hon Wai Thank you. Q & A