AM 121: Intro to Optimization Models and Methods Fall 2018

Similar documents
AM 121: Intro to Optimization

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

AM 121: Intro to Optimization Models and Methods

Simplex Algorithm Using Canonical Tableaus

IE 5531: Engineering Optimization I

ECE 307 Techniques for Engineering Decisions

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

1 Review Session. 1.1 Lecture 2

The Simplex Method. Standard form (max) z c T x = 0 such that Ax = b.

Lecture 5 Simplex Method. September 2, 2009

February 17, Simplex Method Continued

Part 1. The Review of Linear Programming

AM 121: Intro to Optimization! Models and Methods! Fall 2018!

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

9.1 Linear Programs in canonical form

Lesson 27 Linear Programming; The Simplex Method

Lecture 2: The Simplex method

IE 400: Principles of Engineering Management. Simplex Method Continued

Math Models of OR: Some Definitions

The Simplex Method for Solving a Linear Program Prof. Stephen Graves

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

Simplex method(s) for solving LPs in standard form

Systems Analysis in Construction

The Simplex Method. Lecture 5 Standard and Canonical Forms and Setting up the Tableau. Lecture 5 Slide 1. FOMGT 353 Introduction to Management Science

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

Simplex tableau CE 377K. April 2, 2015

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

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

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

Gauss-Jordan Elimination for Solving Linear Equations Example: 1. Solve the following equations: (3)

TIM 206 Lecture 3: The Simplex Method

3 The Simplex Method. 3.1 Basic Solutions

Linear programs Optimization Geoff Gordon Ryan Tibshirani

Special cases of linear programming

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

Ω R n is called the constraint set or feasible set. x 1

CO350 Linear Programming Chapter 8: Degeneracy and Finite Termination

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

Part 1. The Review of Linear Programming

Week_4: simplex method II

OPERATIONS RESEARCH. Linear Programming Problem

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

Chapter 5 Linear Programming (LP)

F 1 F 2 Daily Requirement Cost N N N

Linear & Integer programming

Slide 1 Math 1520, Lecture 10

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

ORF 522. Linear Programming and Convex Analysis

The Simplex Algorithm

CPS 616 ITERATIVE IMPROVEMENTS 10-1

IE 400 Principles of Engineering Management. The Simplex Algorithm-I: Set 3

Simplex Method for LP (II)

CO350 Linear Programming Chapter 8: Degeneracy and Finite Termination

Math 273a: Optimization The Simplex method

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

21. Solve the LP given in Exercise 19 using the big-m method discussed in Exercise 20.

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

Review Solutions, Exam 2, Operations Research

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

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

Math Models of OR: The Revised Simplex Method

Lecture slides by Kevin Wayne

February 22, Introduction to the Simplex Algorithm

IE 5531: Engineering Optimization I

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

Introduction to Mathematical Programming IE406. Lecture 13. Dr. Ted Ralphs

Linear Programming Redux

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

Slack Variable. Max Z= 3x 1 + 4x 2 + 5X 3. Subject to: X 1 + X 2 + X x 1 + 4x 2 + X X 1 + X 2 + 4X 3 10 X 1 0, X 2 0, X 3 0

IP Cut Homework from J and B Chapter 9: 14, 15, 16, 23, 24, You wish to solve the IP below with a cutting plane technique.

Example Bases and Basic Feasible Solutions 63 Let q = >: ; > and M = >: ;2 > and consider the LCP (q M). The class of ; ;2 complementary cones

OPRE 6201 : 3. Special Cases

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

Linear Programming, Lecture 4

Operations Research Lecture 2: Linear Programming Simplex Method

CSC Design and Analysis of Algorithms. LP Shader Electronics Example

Civil Engineering Systems Analysis Lecture XII. Instructor: Prof. Naveen Eluru Department of Civil Engineering and Applied Mechanics

The dual simplex method with bounds

Chapter 4 The Simplex Algorithm Part II

Notes on Simplex Algorithm

Distributed Real-Time Control Systems. Lecture Distributed Control Linear Programming

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

Chapter 4 The Simplex Algorithm Part I

The Dual Simplex Algorithm

CO350 Linear Programming Chapter 6: The Simplex Method

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

Optimization (168) Lecture 7-8-9

ORF 522. Linear Programming and Convex Analysis

min3x 1 + 4x 2 + 5x 3 2x 1 + 2x 2 + x 3 6 x 1 + 2x 2 + 3x 3 5 x 1, x 2, x 3 0.

Farkas Lemma, Dual Simplex and Sensitivity Analysis

MAT016: Optimization

Contents. 4.5 The(Primal)SimplexMethod NumericalExamplesoftheSimplexMethod

The Simplex Algorithm and Goal Programming

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

Linear Programming and the Simplex method

Chapter 7 Network Flow Problems, I

In Chapters 3 and 4 we introduced linear programming

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

Chap6 Duality Theory and Sensitivity Analysis

Math Models of OR: Sensitivity Analysis

Transcription:

AM 121: Intro to Optimization Models and Methods Fall 2018 Lecture 5: The Simplex Method Yiling Chen Harvard SEAS Lesson Plan This lecture: Moving towards an algorithm for solving LPs Tableau. Adjacent BFS. The simplex method Jensen & Bard: 3.4, 3.5, 3.6, 3.10 (for matrix representation) 1

Warm-up Canonical form Equivalent canonical form max c T x max z s.t. Ax=b s.t. z - c T x =0 Ax=b We re interested in constructing a tableau that corresponds to a basis B A tableau is a system of equations Represents everything about an LP Example max x 1 + x 2 s.t. x 1 + x 3 = 2 x 1 + 2x 2 + x 4 = 4 x 1, x 2, x 3, x 4 0 max z s.t. z - x 1 - x 2 = 0 x 1 + x 3 = 2 x 1 + 2x 2 + x 4 = 4 x 1, x 2, x 3, x 4 0 The tableau corresponding to basis {3,4} is: z - x 1 - x 2 = 0 x 1 + x 3 = 2 x 1 + 2x 2 + x 4 = 4 (everything about LP!) 2

The Tableau max z s.t. z - c T x =0 Ax=b Definition. The tableau for basis B is a system of eqns where the basic variables are isolated. For basis B (with B =N \ B) the tableau is: Basic solution x B = b, x B =0. z + c T B 0x B 0 = v Objective z = v Feasible when b 0 Ix B + ĀB 0x B 0 = b Parameters A, c, v, b different from those without bar RHS may be negative Insisting on x B =0 adds an additional n-m constraints. Pins down a solution to the LP! Constructing a Tableau Construct the tableau for basis B: max z s.t. z - c T x =0 Ax=b z + c T B 0x B 0 = v Ix B + ĀB 0x B 0 = b a. Row operations to transform second row Multiply by A 1 B A IxB + A 1 B A B 0x B 0 = A 1 B b B x B + A B 0x B 0 = b (*) Let and 3

Constructing a Tableau Construct the tableau for basis B: max z s.t. z - c T x =0 Ax=b b. Row operations to transform first row z + c T B 0x B 0 = v Ix B + ĀB 0x B 0 = b (*) Constructing a Tableau Construct the tableau for basis B: max z s.t. z - c T x =0 Ax=b b. Row operations to transform first row z + c T B 0x B 0 = v Ix B + ĀB 0x B 0 = b (*) 4

Constructing a Tableau Construct the tableau for basis B: max z s.t. z - c T x =0 Ax=b b. Row operations to transform first row z + c T B 0x B 0 = v Ix B + ĀB 0x B 0 = b (*) Let c T B = 0 ct B A 1 B A B 0 ct B and 0 v = c T B A 1 B b Constructing a Tableau Construct the tableau for basis B: max z s.t. z - c T x =0 Ax=b b. Row operations to transform first row z + c T B 0x B 0 = v Ix B + ĀB 0x B 0 = b (*) Let c T B = 0 ct B A 1 B A B 0 ct B and 0 v = c T B A 1 B b 5

Constructing a Tableau Construct the tableau for basis B: max z s.t. z - c T x =0 Ax=b b. Row operations to transform first row z + c T B 0x B 0 = v Ix B + ĀB 0x B 0 = b (*) Let c T B = 0 ct B A 1 B A B 0 ct B and 0 v = c T B A 1 B b Example: Tableau (1 of 3) z - x 1 - x 2 = 0 (a) x 1 + x 3 = 2 (b) x 1 + 2x 2 + x 4 = 4 (c) How obtain tableau for B={1,4}? Subtract (b) from (c); add (b) to (a): z - x 2 + x 3 = 2 x 1 + x 3 = 2 2x 2 - x 3 + x 4 = 2 BFS? Objective? x=(2,0,0,2) ; z=2. An improvement! x=(0,0,2,4) B={3,4} x=(2,0,0,2) B={1,4} 6

Example: Tableau (2 of 3) z - x 2 + x 3 = 2 x 1 + x 3 = 2 2x 2 - x 3 + x 4 = 2 x=(2,0,0,2) B={1,4} How can we improve further? Increase x 2 :=t; keep x 3 =0; z= 2+t Feasibility: x 4 =2 2t. Set x 2 :=1, because x 4 <0 for t>1. New basis B={1,2}. x=(2,1,0,0), z=3. Have 2 enter basis. What leaves? Example: Tableau (3 of 3) z - x 2 + x 3 = 2 x 1 + x 3 = 2 Get tableau for B={1,2} 2x 2 - x 3 + x 4 = 2 z + + ½ x 3 + ½ x 4 = 3 x 1 + x 3 = 2 x 2 - ½ x 3 + ½ x 4 = 1 (a) (b) (c) x=(2,0,0,2) B={1,4} x=(2,1,0,0) B={1,2} Obj coeff of nonbasic vars >= 0. Solution optimal! Must have z = 3- ½ x 3 ½ x 4 3 for any feasible solution, since x 3, x 4 0. 7

From Basis to Tableau and Back Theorem. If B is a basis for matrix A then there is a tableau for B. If there is a tableau for B then B is a basis for A. Proof (è) row operations to isolate the variables x B (possible since A B is invertible) (ç) B is a basis because A B =I, and therefore A B spans. Adjacent Bases Definition. Two bases for matrix A are adjacent if they share all but one column Example max z = x 1 + x 2 s.t. x 1 + x 3 = 2 x 1 + 2x 2 + x 4 = 4 x 1, x 2, x 3, x 4 0 Five bases {1,2}, {1,3}, {1,4}, {2,3}, {3,4}. B={1,2} is adjacent to {1,3}, not {3,4}. 8

The Simplex Method Work in tableau form. Step (i). Find an initial BFS. Next lecture Step (ii). Determine if current BFS is optimal. If not, find an adjacent BFS with a larger z-value. Repeat. How fast is this? Number of possible BFS is n choose m n C m = n! / (n-m)! m! 20 C 10 =184,756 Even if we can avoid cycling gets large. degeneracy will lead to concern about cycling (next lecture) 9

Empirical performance Simplex Method - Overview Canonical form: max z s.t. z - c T x = 0 Ax=b, Step 0. Initialization Step 1. Check optimality. Step 2. Choose entering index. Step 3. Check unboundedness. Step 4. Choose leaving index. Step 5. Pivot to a new tableau. To step 1. 10

Simplex Method - Overview max z s.t. z + j 2 B c j x j = v x i + j B a ij x j = b i (i B) (assume b i 0) 2 2 Step 0. Initialization (find a BFS and tableau) Step 1. If c j 0 for all j 2B, stop (optimal) Step 2. Else, pick entering index k 2B with c k <0. Step 3. If a ik 0 for all i 2B, stop (unbounded) Step 4. Ratio test. t * = min{ b i /a ik : i 2B, a ik >0}. Pick leaving index r 2B with min ratio. Step 5. Pivot on (r,k) entry to get a tableau for B:=B [{k}\{r}. Example of Simplex Method z - x 1 - x 2 = 0 Basic x 3 x 4 x 1 + x 3 = 2 Ratio 2/1 4/1 x 1 + 2x 2 + x 4 = 4 x 1 to enter. x 3 to leave. pivot(3,1) z - x 2 + x 3 = 2 Basic x 1 x 4 x 1 + x 3 = 2 Ratio 2/2 2 x 2 - x 3 +x 4 = 2 x 2 to enter. x 4 to leave. pivot(4,2) z + ½ x 3 + ½ x 4 = 3 x 1 + x 3 = 2 x 2 ½ x 3 + ½ x 4 = 1 Basic x 1 x 2 Reduced costs all nonnegative. Stop! Solution: (x 1,x 2,x 3,x 4 )=(2,1,0,0), z=3. 11

Review Step 0: Initialization Find a basis and initial tableau corresponding to a BFS next lecture 12

Step 1: Check optimality If c j 0 (for all j in B ) then stop, current solution is optimal. Value z = v. Any feasible solution satisfies z = v - c T x B v, since c 0 and x 0. Non-negative reduced costs is a sufficient test for optimality. [It is a valid test even if a solution is degenerate, discussed in next lecture.] Step 2: Choose Entering Index Pick some k in B with c k <0 to enter the basis, so that the obj value increases with x k Say that c k is the reduced cost of nonbasic variable x k. Amount by which z decreases when x k increases (and so c k <0 is good). 13

Step 3: Check Unboundedness x i + j B a ij x j = b i (for all i 2 2 B) Because other nonbasic vars = 0, we can increase x k while: x i = b i a ik x k 0 (for all i 2B) If a ik 0 for every i in B, then x k can increase without bound (since x i can increase without affecting objective)! Stop: objective value is unbounded. Step 4: Choose Leaving Index Need: x i = b i a ik x k 0; and so x k b i / a ik (where a ik > 0). Ratio test: t * = min{ b i /a ik : i in B, a ik >0} Let R denote basic vars with min ratio Pick some r in R as leaving index; set x k := t* (may be zero) New basic variable x k kicks out the removed variable x r 14

Step 5: Pivot to new tableau Definition. A pivot on (r,k) is row operations to construct tableau for B:=B [{k}\{r}. (a) Divide row x r + j 2 B a rj x r =b r through by a rk so that coefficient of new basic variable x k becomes 1. (Why does RHS remain nonnegative?) (b) Add/subtract multiples of this adjusted row to all other equations (including objective) to remove x k (Why do these operations not affect coeffs for other basic vars?) [Note: we re doing Gauss-Jordan elimination. ] Degeneracy A BFS is degenerate if one or more basic variables have value zero. In this case (unless unbounded), t* = 0 and simplex method cannot make the entering variable increase in value. Simplex will move to an adjacent basis, but without improving the objective. For now we ignore this possibility. 15

Summary: Simplex Method A tableau is system of eqns that correspond to a basis and represent all details of the LP the basic variables are isolated The simplex method changes the tableau when searching through BFS. Pivots through adjacent BFSs until prove LP is unbounded or find an optimal solution. Fast in practice! Next lecture How to initialize the simplex method? Provable termination even when simplex method encounters a degenerate BFS? 16