The Simplex Algorithm: Technicalities 1

Similar documents
The Strong Duality Theorem 1

Optimization (168) Lecture 7-8-9

CO350 Linear Programming Chapter 8: Degeneracy and Finite Termination

AM 121: Intro to Optimization

LP. Lecture 3. Chapter 3: degeneracy. degeneracy example cycling the lexicographic method other pivot rules the fundamental theorem of LP

Standard Form An LP is in standard form when: All variables are non-negativenegative All constraints are equalities Putting an LP formulation into sta

Simplex method(s) for solving LPs in standard form

3 Does the Simplex Algorithm Work?

Linear Programming, Lecture 4

Discrete Optimization. Guyslain Naves

Dual Basic Solutions. Observation 5.7. Consider LP in standard form with A 2 R m n,rank(a) =m, and dual LP:

The simplex algorithm

Dr. Maddah ENMG 500 Engineering Management I 10/21/07

Example. 1 Rows 1,..., m of the simplex tableau remain lexicographically positive

Week 2. The Simplex method was developed by Dantzig in the late 40-ties.

Termination, Cycling, and Degeneracy

min 4x 1 5x 2 + 3x 3 s.t. x 1 + 2x 2 + x 3 = 10 x 1 x 2 6 x 1 + 3x 2 + x 3 14

III. Linear Programming

ORF 522. Linear Programming and Convex Analysis

1 Review Session. 1.1 Lecture 2

9.1 Linear Programs in canonical form

IE 400: Principles of Engineering Management. Simplex Method Continued

3 The Simplex Method. 3.1 Basic Solutions

February 17, Simplex Method Continued

A primal-simplex based Tardos algorithm

Ann-Brith Strömberg. Lecture 4 Linear and Integer Optimization with Applications 1/10

4.5 Simplex method. LP in standard form: min z = c T x s.t. Ax = b

Summary of the simplex method

CSC373: Algorithm Design, Analysis and Complexity Fall 2017 DENIS PANKRATOV NOVEMBER 1, 2017

Lecture 4: Algebra, Geometry, and Complexity of the Simplex Method. Reading: Sections 2.6.4, 3.5,

CO 602/CM 740: Fundamentals of Optimization Problem Set 4

CO350 Linear Programming Chapter 6: The Simplex Method

15-780: LinearProgramming

Linear Programming. Linear Programming I. Lecture 1. Linear Programming. Linear Programming

Introduction to Linear Programming

Introduce the idea of a nondegenerate tableau and its analogy with nondenegerate vertices.

ORF 307: Lecture 4. Linear Programming: Chapter 3 Degeneracy

Lecture 11: Post-Optimal Analysis. September 23, 2009

GETTING STARTED INITIALIZATION

1 Overview. 2 Extreme Points. AM 221: Advanced Optimization Spring 2016

Lecture 2: The Simplex method

Motivating examples Introduction to algorithms Simplex algorithm. On a particular example General algorithm. Duality An application to game theory

MATH 445/545 Homework 2: Due March 3rd, 2016

CSCI5654 (Linear Programming, Fall 2013) Lecture-8. Lecture 8 Slide# 1

Summary of the simplex method

The Simplex Algorithm

MATH2070 Optimisation

Section Notes 9. IP: Cutting Planes. Applied Math 121. Week of April 12, 2010

CO350 Linear Programming Chapter 8: Degeneracy and Finite Termination

Prelude to the Simplex Algorithm. The Algebraic Approach The search for extreme point solutions.

LINEAR PROGRAMMING I. a refreshing example standard form fundamental questions geometry linear algebra simplex algorithm

Math 16 - Practice Final

Lecture slides by Kevin Wayne

MATH 445/545 Test 1 Spring 2016

Lecture 6 Simplex method for linear programming

Today s class. Constrained optimization Linear programming. Prof. Jinbo Bi CSE, UConn. Numerical Methods, Fall 2011 Lecture 12

4.5 Simplex method. min z = c T x s.v. Ax = b. LP in standard form

ORF 307: Lecture 2. Linear Programming: Chapter 2 Simplex Methods

The augmented form of this LP is the following linear system of equations:

Linear Programming. Jie Wang. University of Massachusetts Lowell Department of Computer Science. J. Wang (UMass Lowell) Linear Programming 1 / 47

Special cases of linear programming

Yinyu Ye, MS&E, Stanford MS&E310 Lecture Note #06. The Simplex Method

December 2014 MATH 340 Name Page 2 of 10 pages

Simplex Method: More Details

Linear Programming Duality

Metode Kuantitatif Bisnis. Week 4 Linear Programming Simplex Method - Minimize

2.098/6.255/ Optimization Methods Practice True/False Questions

Review Solutions, Exam 2, Operations Research

Linear Programming: Simplex

MAT016: Optimization

CSC Design and Analysis of Algorithms. LP Shader Electronics Example

The Avis-Kalunzy Algorithm is designed to find a basic feasible solution (BFS) of a given set of constraints. Its input: A R m n and b R m such that

LOWER BOUNDS FOR THE MAXIMUM NUMBER OF SOLUTIONS GENERATED BY THE SIMPLEX METHOD

Optimisation and Operations Research

Introduction to Operations Research

The use of shadow price is an example of sensitivity analysis. Duality theory can be applied to do other kind of sensitivity analysis:

Lecture Simplex Issues: Number of Pivots. ORIE 6300 Mathematical Programming I October 9, 2014

CSCI 1951-G Optimization Methods in Finance Part 01: Linear Programming

Developing an Algorithm for LP Preamble to Section 3 (Simplex Method)

Chapter 4 The Simplex Algorithm Part II

Simplex Algorithm Using Canonical Tableaus

Lecture 14: October 11

Lecture 9 Tuesday, 4/20/10. Linear Programming

CS Algorithms and Complexity

CHAPTER 2. The Simplex Method

LINEAR PROGRAMMING. Relation to the Text (cont.) Relation to Material in Text. Relation to the Text. Relation to the Text (cont.

A Strongly Polynomial Simplex Method for Totally Unimodular LP

Math 273a: Optimization The Simplex method

Duality. Peter Bro Mitersen (University of Aarhus) Optimization, Lecture 9 February 28, / 49

Linear programming on Cell/BE

The Primal-Dual Algorithm P&S Chapter 5 Last Revised October 30, 2006

Lecture 5. x 1,x 2,x 3 0 (1)

1 date: February 23, 1998 le: papar1. coecient pivoting rule. a particular form of the simplex algorithm.

IE 5531: Engineering Optimization I

In Chapters 3 and 4 we introduced linear programming

Notes on Simplex Algorithm

Lecture 5 Simplex Method. September 2, 2009

Linear Programming: Chapter 5 Duality

Example Problem. Linear Program (standard form) CSCI5654 (Linear Programming, Fall 2013) Lecture-7. Duality

Introduction to Linear and Combinatorial Optimization (ADM I)

Transcription:

1/45 The Simplex Algorithm: Technicalities 1 Adrian Vetta 1 This presentation is based upon the book Linear Programming by Vasek Chvatal

2/45 Two Issues Here we discuss two potential problems with the simplex method and how to avoid them. Termination. How can we ensure that the algorithm terminates? Initialialisation. How can we ensure that the algorithm starts?

3/45 Part I Termination: Cycling

4/45 Choosing Pivots Entering Variable. We may chose any non-basic variable with a positive coefficient in the top row of the dictionary to enter the basis. If there is more than one choice to enter, which do we pick? Leaving Variable. We may chose any basic variable whose non-negativity imposes the most stringent constraint on the entering variable to leave the basis. If there is more than one choice to leave, which do we pick?

5/45 Degeneracy Leaving Variable. We may chose any basic variable whose non-negativity imposes the most stringent constraint on the entering variable to leave the basis. If two basic variables x i, x j can be selected to leave the basis then their values are both forced to zero by the entering variable. Since one of them, say x i, must stay in the basis, we now have a basic variable whose value is zero. [Its constant term in the dictionary is 0.] Basic solutions with some basic variables of value zero are called degenerate. For a pivot at a degenerate solution, the objective value will not increase, nor will any of the variable values change.

6/45 Cycling So pivots at degenerate solutions do not lead to better solutions. Is it possible that the algorithm can get stuck (before it finds an optimal solution) in a sequence of degenerate solutions? YES. - If we are not careful in how we choose our pivots.

/45 An Example of Cycling Assume we use the following rules for selecting pivots: Entering Variable. Add the non-basic variable with the highest positive coefficient. Leaving Variable. In case of a tie, remove the basic variable with the smallest subscript. Apply these rules to the following example. maximise 10x 1 57x 2 9x 3 24x 4 1 subject to 2 x 1 11 2 x 2 5 2 x 3 + 9x 4 0 1 2 x 1 3 2 x 2 1 2 x 3 + x 4 0 x 1 1 x 1, x 2, x 3, x 4 0

8/45 Dictionary Form maximise 10x 1 57x 2 9x 3 24x 4 1 11 subject to x1 2 2 x2 5 x3 + 9x4 0 2 1 2 x1 3 2 x2 1 x3 + x4 0 2 x 1 1 x 1, x 2, x 3, x 4 0 Write in dictionary form. z = 10x 1 57x 2 9x 3 24x 4 x 5 = 1 2 x 1 + 11 2 x 2 + 5 2 x 3 9x 4 x 6 = 1 2 x 1 + 3 2 x 2 + 1 2 x 3 x 4 x 7 = 1 x 1

9/45 Pivot 1 z = 10x 1 57x 2 9x 3 24x 4 x 5 = 1 2 x 1 + 11 2 x 2 + 5 2 x 3 9x 4 x 6 = 1 2 x 1 + 3 2 x 2 + 1 2 x 3 x 4 x 7 = 1 x 1 Pivot: Add x 1 to basis. (We had no choice.) Remove x 5 from basis. (We had the choice of x 5 or x 6 ). z = 10(11x 2 + 5x 3 18x 4 2x 5) 57x 2 9x 3 24x 4 x 1 = 11x 2 + 5x 3 18x 4 2x 5 x 6 = 1 2 (11x2 + 5x3 18x4 2x5) + 3 2 x2 + 1 x3 2 x 7 = 1 (11x 2 + 5x 3 18x 4 2x 5) x4 z = 53x 2 + 41x 3 204x 3 20x 5 x 1 = 11x 2 + 5x 3 18x 4 2x 5 x 6 = 4x 2 2x 3 + 8x 4 + x 5 x 7 = 1 11x 2 5x 3 + 18x 4 + 2x 5

10/45 Pivot 2 z = 53x 2 + 41x 3 204x 3 20x 5 x 1 = 11x 2 + 5x 3 18x 4 2x 5 x 6 = 4x 2 2x 3 + 8x 4 + x 5 x 7 = 1 11x 2 5x 3 + 18x 4 + 2x 5 Pivot: Add x 2 to basis. (It has a higher coefficient than x 3.) Remove x 6 from basis. (We had no choice; x 1 is unconstrained by x 2 ). z = 53( 1 2 x3 + 2x4 + 1 4 x5 1 x6) + 41x3 204x3 20x5 4 1 x 2 = 2 x3 + 2x4 + 1 4 x5 1 4 x6 x 1 = 11( 1 2 x3 + 2x4 + 1 4 x5 1 x6) + 5x3 18x4 2x5 4 x 7 = 1 11( 1 2 x3 + 2x4 + 1 4 x5 1 x6) 5x3 + 18x4 + 2x5 4 z = 29 2 x 3 98x 4 27 4 x 5 53 4 x 6 x 2 = 1 2 x 3 + 2x 4 + 1 4 x 5 1 4 x 6 x 1 = 1 2 x 3 + 4x 4 + 3 4 x 5 11 4 x 6 x 7 = 1 + 1 2 x 3 4x 4 3 4 x 5 + 11 4 x 6

1/45 Pivot 3 29 27 z = x3 98x4 2 4 x5 53 4 x6 x 2 = 1 2 x3 + 2x4 + 1 4 x5 1 4 x6 x 1 = 1 2 x3 + 4x4 + 3 4 x5 11 4 x6 x 7 = 1 + 1 2 x3 4x4 3 4 x5 + 11 4 x6 Pivot: Add x 3 to basis. (No choice.) Remove x 1 from basis. (We had the choice of choice of x 1 or x 2.) 29 z = 2 (8x4 + 3 2 x5 11 2 x6 2x1) 98x4 27 53 x5 4 4 x6 x 3 = 8x 4 + 3 2 x5 11 x6 2x1 2 x 2 = 1 2 (8x4 + 3 2 x5 11 2 x6 2x1) + 2x4 + 1 4 x5 1 4 x6 x 7 = 1 + 1 2 (8x4 + 3 2 x5 11 2 x6 2x1) 4x4 3 11 x5 + 4 4 x6 z = 18x 4 + 15x 5 93x 6 29x 1 x 3 = 8x 4 + 3 2 x 5 11 2 x 6 2x 1 x 2 = 2x 4 1 2 x 5 + 5 2 x 6 + x 1 x 7 = 1 x 1

12/45 Pivot 4 z = 18x 4 + 15x 5 93x 6 29x 1 x 3 = 8x 4 + 3 2 x5 11 x6 2x1 2 x 2 = 2x 4 1 2 x5 + 5 x6 + x1 2 x 7 = 1 x 1 Pivot: Add x 4 to basis. (It has a higher coefficient than x 5.) Remove x 2 from basis. (No choice as x 3 unconstrained by x 4.) z = 18( 1 4 x5 + 5 4 x6 + 1 2 x1 1 x2) + 15x5 93x6 29x1 2 1 x 4 = 4 x5 + 5 4 x6 + 1 2 x1 1 2 x2 x 3 = 8( 1 4 x5 + 5 4 x6 + 1 2 x1 1 x2) + 3 2 2 x5 11 x6 2x1 2 x 7 = 1 x 1 21 z = 2 x 5 141 2 x 6 20x 1 9x 2 x 4 = 1 4 x 5 + 5 4 x 6 + 1 2 x 1 1 2 x 2 x 3 = 1 2 x 5 + 9 2 x 6 + 2x 1 4x 2 x 7 = 1 x 1

13/45 Pivot 5 21 2 z = x 4 = 1 4 x5 + 5 4 x6 + 1 2 x1 1 2 x2 141 x5 x6 20x1 9x2 2 x 3 = 1 2 x5 + 9 2 x 7 = 1 x 1 x6 + 2x1 4x2 Pivot: Add x 5 to basis. (No choice.) Remove x 3 from basis. (We had the choice of x 3 or x 4.) 21 141 z = (9x6 + 4x1 8x2 2x3) x6 20x1 9x2 2 2 x 5 = 9x 6 + 4x 1 8x 2 2x 3 x 4 = 1 4 (9x6 + 4x1 8x2 2x3) + 5 4 x6 + 1 2 x1 1 2 x2 x 7 = 1 x 1 z = 24x 6 + 22x 1 93x 2 21x 3 x 5 = 9x 6 + 4x 1 8x 2 2x 3 x 4 = x 6 1 2 x 1 + 3 2 x 2 + x 7 = 1 x 1 1 2 x 3

14/45 Pivot 6 z = 24x 6 + 22x 1 93x 2 21x 3 x 5 = 9x 6 + 4x 1 8x 2 2x 3 x 4 = x 6 1 2 x1 + 3 2 x2 + x 7 = 1 x 1 1 2 x3 Pivot: Add x 6 to basis. (It has a higher coefficient than x 1.) Remove x 4 from basis. (No choice as x 5 unconstrained by x 6.) z = 24( 1 2 x1 + 3 2 x2 + 1 x3 x4) + 22x1 93x2 21x3 2 1 x 6 = 2 x1 + 3 2 x2 + 1 x3 x4 2 x 5 = 9( 1 2 x1 + 3 2 x2 + 1 x3 x4) + 4x1 8x2 2x3 2 x 7 = 1 x 1 z = 10x 1 57x 2 9x 3 24x 4 x 6 = 1 2 x 1 + 3 2 x 2 + 1 2 x 3 x 4 x 5 = 1 2 x 1 + 11 2 x 2 + 5 2 x 3 9x 4 x 7 = 1 x 1

15/45 A Cycle is Obtained z = 10x 1 57x 2 9x 3 24x 4 x 6 = 1 2 x1 + 3 2 x2 + 1 x3 x4 2 x 5 = 1 2 x1 + 11 2 x2 + 5 x3 9x4 2 x 7 = 1 x 1 But this is exactly the same as the original dictionary! z = 10x 1 57x 2 9x 3 24x 4 x 5 = 1 2 x 1 + 11 2 x 2 + 5 2 x 3 9x 4 x 6 = 1 2 x 1 + 3 2 x 2 + 1 2 x 3 x 4 x 7 = 1 x 1 We are stuck in a cycle (with top row coefficients not all negative). So the simplex algorithm did not terminate!

16/45 Part II Bland s Rule

17/45 Bland s Rule Can we stop the algorithm from cycling? YES. - If we are more careful in how we choose the entering and leaving variables. Bland s Rule. Given a choice, always choose the variable with the smallest subscript (for both entering and leaving variables).

18/45 Bland s Rule: Pivot 1 Let s see how this works with the previous example. z = 10x 1 57x 2 9x 3 24x 4 x 5 = 1 2 x 1 + 11 2 x 2 + 5 2 x 3 9x 4 x 6 = 1 2 x 1 + 3 2 x 2 + 1 2 x 3 x 4 x 7 = 1 x 1 Pivot: Add x 1 to basis. (We had no choice.) Remove x 5 from basis. (It has a lower subscript than x 6.) z = 53x 2 + 41x 3 204x 3 20x 5 x 1 = 11x 2 + 5x 3 18x 4 2x 5 x 6 = 4x 2 2x 3 + 8x 4 + x 5 x 7 = 1 11x 2 5x 3 + 18x 4 + 2x 5

19/45 Bland s Rule: Pivot 2 z = 53x 2 + 41x 3 204x 3 20x 5 x 1 = 11x 2 + 5x 3 18x 4 2x 5 x 6 = 4x 2 2x 3 + 8x 4 + x 5 x 7 = 1 11x 2 5x 3 + 18x 4 + 2x 5 Pivot: Add x 2 to basis. (It has a lower subscript than x 3.) Remove x 6 from basis. (We had no choice; x 1 is unconstrained by x 2.) z = 29 2 x 3 98x 4 27 4 x 5 53 4 x 6 x 2 = 1 2 x 3 + 2x 4 + 1 4 x 5 1 4 x 6 x 1 = 1 2 x 3 + 4x 4 + 3 4 x 5 11 4 x 6 x 7 = 1 + 1 2 x 3 4x 4 3 4 x 5 + 11 4 x 6

0/45 Bland s Rule: Pivot 3 29 27 z = x3 98x4 2 4 x5 53 4 x6 x 2 = 1 2 x3 + 2x4 + 1 4 x5 1 4 x6 x 1 = 1 2 x3 + 2x4 + 3 4 x5 11 4 x6 x 7 = 1 + 1 2 x3 4x4 3 4 x5 53 4 x6 Pivot: Add x 3 to basis. (No choice.) Remove x 1 from basis. (It has a lower subscript x 2.) z = 18x 4 + 15x 5 93x 6 29x 1 x 3 = 8x 4 + 3 2 x 5 11 2 x 6 2x 1 x 2 = 2x 4 1 2 x 5 + 5 2 x 6 + x 1 x 7 = 1 x 1

21/45 Bland s Rule: Pivot 4 z = 18x 4 + 15x 5 93x 6 29x 1 x 3 = 8x 4 + 3 2 x5 + 11 x6 9x1 2 x 2 = 2x 4 9 2 x5 + 5 x6 + x1 2 x 7 = 1 x 1 Pivot: Add x 4 to basis. (It has a lower subscript than x 5.) Remove x 2 from basis. (No choice as x 3 unconstrained by x 4.) 21 z = 2 x 5 141 2 x 6 20x 1 9x 2 x 4 = 1 4 x 5 + 5 4 x 6 + 1 2 x 1 1 2 x 2 x 3 = 1 2 x 5 + 9 2 x 6 + 2x 1 4x 2 x 7 = 1 x 1

22/45 Bland s Rule: Pivot 5 21 2 z = x 4 = 1 4 x5 + 5 4 x6 + 1 2 x1 1 2 x2 141 x5 x6 20x1 9x2 2 x 3 = 1 2 x5 + 9 2 x 7 = 1 x 1 x6 + 2x1 4x2 Pivot: Add x 5 to basis. (No choice.) Remove x 3 from basis. (It has a lower subscript than x 4.) z = 24x 6 + 22x 1 93x 2 21x 3 x 5 = 9x 6 + 4x 1 8x 2 2x 3 x 4 = x 6 1 2 x 1 + 3 2 x 2 + x 7 = 1 x 1 1 2 x 3

23/45 Bland s Rule: Pivot 6 z = 24x 6 + 22x 1 93x 2 21x 3 x 5 = 9x 6 + 4x 1 8x 2 2x 3 x 4 = x 6 1 2 x1 + 3 2 x2 + x 7 = 1 x 1 1 2 x3 So far all our pivots has been the same as before, but now... Pivot: Add x 1 to basis. (It has a lower subscript than x 6.) Remove x 4 from basis. (No choice as x 5 unconstrained by x 6.) z = 24x 6 + 22( 2x 6 + 3x 2 + x 3 2x 4) 93x 2 21x 3 x 1 = 2x 6 + 3x 2 + x 3 2x 4 x 5 = 9x 6 + 4( 2x 6 + 3x 2 + x 3 2x 4) 8x 2 2x 3 x 7 = 1 ( 2x 6 + 3x 2 + x 3 2x 4) z = 20x 6 27x 2 + x 3 44x 4 x 1 = 2x 6 + 3x 2 + x 3 2x 4 x 5 = x 6 + 4x 2 + 2x 3 8x 4 x 7 = 1 + 2x 6 3x 2 x 3 2x 4

24/45 Bland s Rule: Pivot 7 z = 20x 6 27x 2 + x 3 44x 4 x 1 = 2x 6 + 3x 2 + x 3 2x 4 x 5 = x 6 + 4x 2 + 2x 3 8x 4 x 7 = 1 + 2x 6 3x 2 x 3 2x 4 Pivot: Add x 3 to basis. (No choice.) Remove x 7 from basis. (No choice as x 1, x 5 unconstrained by x 3.) z = 20x 6 27x 2 + (1 + 2x 6 3x 2 2x 4 x 7) 44x 4 x 3 = 1 + 2x 6 3x 2 2x 4 x 7 x 1 = 2x 6 + 3x 2 + (1 + 2x 6 3x 2 2x 4 x 7) 2x 4 x 5 = x 6 + 4x 2 + 2(1 + 2x 6 3x 2 2x 4 x 7) 8x 4 z = 1 18x 6 30x 2 46x 4 x 7 x 3 = 1 + 2x 6 3x 2 2x 4 x 7 x 1 = 1 4x 4 x 7 x 5 = 2 + 3x 6 2x 2 12x 4 2x 7

25/45 Bland s Rule: Breaking the Cycle z = 1 18x 6 30x 2 46x 4 x 7 x 3 = 1 + 2x 6 3x 2 2x 4 x 7 x 1 = 1 4x 4 x 7 x 5 = 2 + 3x 6 2x 2 12x 4 2x 7 All the coefficients in the top row are now negative. Thus, we break out of the degeneracy and obtain an optimal solution (x 1, x 2, x 3, x 4 ) = (1, 0, 1, 0) and z = 1.

26/45 Remarks Bland s Rule always works: use it and you obtain an optimal solution. There are other methods, e.g. Perturbation Methods, that also work. For proofs and discussions on these issues see Chvatal s book.

27/45 Part III The Starting Point?

28/45 Is the All-Zero Solution Feasible? Suppose we want to solve the linear program maximise subject to n j=1 c jx j n j=1 a ijx j b j i [m] x j 0 j [n] To run the simplex algorithm we need to start with a feasible solution. So far we have used the all-zero solution. But if some b j are negative then the all-zero solution is not feasible! E.g. maximise x 1 x 2 + x 3 subject to 2x 1 x 2 + 2x 3 4 2x 1 3x 2 + x 3 5 x 1 + x 2 2x 3 1 x 1, x 2, x 3 0

29/45 An Auxiliary Problem maximise subject to n j=1 c jx j n j=1 a ijx j b j i [m] x j 0 j [n] But our LP has a feasible solution if and only if the following auxiliary linear program has an optimal solution of value zero. minimise x 0 subject to n j=1 a ijx j x 0 b j i [m] x j 0 j {0, 1,..., n} So can we use an optimal solution to this auxiliary problem to find a feasible solution (and starting dictionary) for our LP? YES.

30/45 Finding a Starting Feasible Solution Let s see how this works on the problem maximise z = x 1 x 2 + x 3 subject to 2x 1 x 2 + 2x 3 4 2x 1 3x 2 + x 3 5 x 1 + x 2 2x 3 1 x 1, x 2, x 3 0 The auxiliary problem is then maximise w = x 0 subject to 2x 1 x 2 + 2x 3 x 0 4 2x 1 3x 2 + x 3 x 0 5 x 1 + x 2 2x 3 x 0 1 x 0, x 1, x 2, x 3 0

31/45 Solving the Auxiliary Problem: a Dictionary maximise w = x 0 subject to 2x 1 x 2 + 2x 3 x 0 4 2x 1 3x 2 + x 3 x 0 5 x 1 + x 2 2x 3 x 0 1 x 0, x 1, x 2, x 3 0 Let s apply the simplex method to this auxiliary problem. First put it in dictionary form. w = x 0 x 4 = 4 2x 1 + x 2 2x 3 + x 0 x 5 = 5 2x 1 + 3x 2 x 3 + x 0 x 6 = 1 + x 1 x 2 + 2x 3 + x 0

32/45 Solving the Auxiliary Problem: an Infeasible Solution w = x 0 x 4 = 4 2x 1 + x 2 2x 3 + x 0 x 5 = 5 2x 1 + 3x 2 x 3 + x 0 x 6 = 1 + x 1 x 2 + 2x 3 + x 0 The only term, i.e. x 0, in the top row has a negative coefficient. But this solution is not feasible for the auxiliary problem. To see this observe that x 5, x 6 < 0. But if we increase x 0 these variables will become non-negative (at the expense of decreasing the objective value). Let s make this pivot and see what happens...

33/45 A Strange Pivot: Pivot 0 w = x 0 x 4 = 4 2x 1 + x 2 2x 3 + x 0 x 5 = 5 2x 1 + 3x 2 x 3 + x 0 x 6 = 1 + x 1 x 2 + 2x 3 + x 0 Pivot: Add x 0 to basis. Remove x 5 from basis. (As x 5 was the most negative basic variable.) w = (5 + 2x 1 3x 2 + x 3 + x 5) x 0 = 5 + 2x 1 3x 2 + x 3 + x 5 x 4 = 4 2x 1 + x 2 2x 3 + (5 + 2x 1 3x 2 + x 3 + x 5) x 6 = 1 + x 1 x 2 + 2x 3 + (5 + 2x 1 3x 2 + x 3 + x 5) w = 5 2x 1 + 3x 2 x 3 x 5 x 0 = 5 + 2x 1 3x 2 + x 3 + x 5 x 4 = 9 2x 2 x 3 + x 5 x 6 = 4 + 3x 1 4x 2 + 3x 3 + x 5

34/45 Solving the Auxiliary Problem: Pivot 1 w = 5 2x 1 + 3x 2 x 3 x 5 x 0 = 5 + 2x 1 3x 2 + x 3 + x 5 x 4 = 9 2x 2 x 3 + x 5 x 6 = 4 + 3x 1 4x 2 + 3x 3 + x 5 Hooray: this is feasible for the auxiliary problem! Pivot: Add x 2 to basis. Remove x 6 from basis. w = 5 2x 1 + 3(1 + 3 4 x1 + 3 4 x3 + 1 4 x5 1 x6) x3 x5 4 x 2 = 1 + 3 4 x1 + 3 4 x3 + 1 4 x5 1 4 x6 x 0 = 5 + 2x 1 3(1 + 3 4 x1 + 3 4 x3 + 1 4 x5 1 x6) + x3 + x5 4 x 4 = 9 2(1 + 3 4 x1 + 3 4 x3 + 1 4 x5 1 x6) x3 + x5 4 w = 2 + 1 4 x 1 + 5 4 x 3 1 4 x 5 3 4 x 6 x 2 = 1 + 3 4 x 1 + 3 4 x 3 + 1 4 x 5 1 4 x 6 x 0 = 2 1 4 x 1 5 4 x 3 + 1 4 x 5 + 3 4 x 6 x 4 = 7 3 2 x 1 5 2 x 3 + 1 2 x 5 + 1 2 x 6

35/45 Solving the Auxiliary Problem: Pivot 2 w = 2 + 1 4 x1 + 5 4 x3 1 4 x5 3 4 x6 x 2 = 1 + 3 4 x1 + 3 4 x3 + 1 4 x5 1 4 x6 x 0 = 2 1 4 x1 5 4 x3 + 1 4 x5 + 3 4 x6 x 4 = 7 3 2 x1 5 2 x3 + 1 2 x5 + 1 2 x6 Pivot: Add x 3 to basis. [Note: here it is quicker not to use Bland s rule.] Remove x 0 from basis. w = 2 + 1 4 x1 + 5 ( 8 1 4 5 5 x1 1 5 x5 + 3 5 x6 4 x0) 1 5 4 x5 3 4 x6 x 2 = 1 + 3 4 x1 + 3 ( 8 1 4 5 5 x1 1 5 x5 + 3 5 x6 4 x0) + 1 5 4 x5 1 x6 x 3 = 8 1 5 5 x1 1 5 x5 + 3 5 x6 4 5 x0 x 4 = 7 3 2 x1 5 ( 8 1 2 5 5 x1 1 5 x5 + 3 5 x6 4 x0) + 1 5 2 x5 + 1 2 x6 w = x 0 x 3 = 8 5 1 5 x 1 1 5 x 5 + 3 5 x 6 4 5 x 0 x 2 = 11 5 + 3 5 x 1 + 2 5 x 5 + 1 5 x 6 3 5 x 0 x 4 = 3 x 1 x 6 + 2x 0

36/45 The Auxiliary Problem: an Optimal Solution w = x 0 x 3 = 8 5 1 5 x1 1 5 x5 + 3 5 x6 4 5 x0 x 2 = 11 5 + 3 5 x1 + 2 5 x5 + 1 5 x6 3 5 x0 x 4 = 3 x 1 x 6 + 2x 0 All coefficients in the top row are now negative. So we have an optimal solution for the auxiliary problem. (x 0, x 1, x 2, x 3, x 4, x 5, x 6 ) = (0, 0, 11 5, 8 5, 3, 0, 0). The objective value is w = x 0 = 0. So this corresponds to a feasible solution to the original problem.

37/45 A Feasible Solution to the Original Problem maximise x 1 x 2 + x 3 subject to 2x 1 x 2 + 2x 3 4 2x 1 3x 2 + x 3 5 x 1 + x 2 2x 3 1 x 1, x 2, x 3 0 So we have an optimal solution for the auxiliary problem. (x 0, x 1, x 2, x 3, x 4, x 5, x 6 ) = (0, 0, 11 5, 8 5, 3, 0, 0). This gives the solution (x 1, x 2, x 3 ) = (0, 11 5, 8 5 ) to the original problem. This is feasible. [Check it!]

38/45 A Feasible Dictionary for the Original Problem maximise x 1 x 2 + x 3 subject to 2x 1 x 2 + 2x 3 4 2x 1 3x 2 + x 3 5 x 1 + x 2 2x 3 1 x 1, x 2, x 3 0 So we have a feasible solution for the original LP. How do we find a feasible starting dictionary? Consider the final dictionary for the auxiliary LP. w = x 0 x 2 = 11 5 + 3 5 x 1 + 2 5 x 5 + 1 5 x 6 3 5 x 0 x 3 = 8 5 1 5 x 1 1 5 x 5 + 3 5 x 6 4 5 x 0 x 4 = 3 x 1 x 6 + 2x 0 Remove the column for x 0 and add back the original objective...

39/45 A Feasible Dictionary for the Original Problem (cont.) maximise x 1 x 2 + x 3 subject to 2x 1 x 2 + 2x 3 4 2x 1 3x 2 + x 3 5 x 1 + x 2 2x 3 1 x 1, x 2, x 3 0 Remove the column for x 0 and add back the original objective. z = x 1 x 2 + x 3 x 2 = 11 5 + 3 5 x1 + 2 5 x5 + 1 5 x6 x 3 = 8 5 1 5 x1 1 5 x5 + 3 5 x6 x 4 = 3 x 1 x 6 z = x 1 ( 11 + 3 5 5 x1 + 2 5 x5 + 1 x6) + ( 8 1 5 5 5 x1 1 5 x5 + 3 x6) 5 x 2 = 11 + 3 5 5 x1 + 2 5 x5 + 1 5 x6 x 3 = 8 1 5 5 x1 1 5 x5 + 3 5 x6 x 4 = 3 x 1 x 6 This gives a feasible dictionary for the original LP. z = 3 + 1 5 5 x1 3 5 x5 + 2 5 x6 x 2 = 11 + 3 5 5 x1 + 2 5 x5 + 1 5 x6 8 x 3 = 1 5 5 x1 1 5 x5 + 3 5 x6 x 4 = 3 x 1 x 6

40/45 The Two Phase Simplex Method So we use a two phase approach to solve the linear program. First we solve the auxiliary problem: Case I. If the optimal value is zero we have a feasible solution for the original. We then run the simplex algorithm for the second time. Case II. If the optimal value is less than zero the original problem is infeasible.

41/45 Part IV Efficiency

42/45 Termination With Bland s Rule the algorithm will terminate. To see this, observe that there are ( ) m+n m bases. The dictionary corresponding to each basis can appear only once. So there are at most ( ) m+n m iterations. But ( ) m+n m >> 2 m+n. Does the algorithm always make an exponential # pivots?

43/45 Typical Running Times The simplex method typically makes O(m) pivots, where m is the number of constraints. Each pivot takes time O(mn) with the dictionary method. [But there are actually faster ways to implement pivots.] So typically the algorithm is fast. On the other hand...

44/45 Exponential Running Times...all known pivot rules have pathological examples on which they make an exponential number of pivots. So the simple algorithm is a fast practical algorithm but has exponential worst case running time. In some sense the simplex algorithm is the exception that proves the rule: Polynomial algorithms good; exponential algorithms bad. In fact, recent theoretical results show the simplex algorithm isn t really an exception to this rule after all. [But that research is beyond the scope of this course...]

45/45 Polynomial Time Algorithms There are polynomial time algorithms for solving linear programs. The ellipsoid method and the interior point method are polytime algorithms. Conjecture. The simplex algorithm is polynomial time if, given a choice, it chooses the pivot variables at random.