Summary of the simplex method

Similar documents
MVE165/MMG631 Linear and integer optimization with applications Lecture 5 Linear programming duality and sensitivity analysis

Summary of the simplex method

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

Linear programs, convex polyhedra, extreme points

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

Chap6 Duality Theory and Sensitivity Analysis

(P ) Minimize 4x 1 + 6x 2 + 5x 3 s.t. 2x 1 3x 3 3 3x 2 2x 3 6

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

Linear programming. Saad Mneimneh. maximize x 1 + x 2 subject to 4x 1 x 2 8 2x 1 + x x 1 2x 2 2

1. Algebraic and geometric treatments Consider an LP problem in the standard form. x 0. Solutions to the system of linear equations

Part 1. The Review of Linear Programming

The Simplex Algorithm

Review Solutions, Exam 2, Operations Research

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

3 The Simplex Method. 3.1 Basic Solutions

9.1 Linear Programs in canonical form

Lecture 2: The Simplex method

1 Review Session. 1.1 Lecture 2

Linear Programming Duality P&S Chapter 3 Last Revised Nov 1, 2004

Note 3: LP Duality. If the primal problem (P) in the canonical form is min Z = n (1) then the dual problem (D) in the canonical form is max W = m (2)

4. Duality and Sensitivity

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

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

The Dual Simplex Algorithm

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

Special cases of linear programming

IE 5531: Engineering Optimization I

TIM 206 Lecture 3: The Simplex Method

AM 121 Introduction to Optimization: Models and Methods Example Questions for Midterm 1

Linear Programming Inverse Projection Theory Chapter 3

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

Simplex Method for LP (II)

Answer the following questions: Q1: Choose the correct answer ( 20 Points ):

Farkas Lemma, Dual Simplex and Sensitivity Analysis

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

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

"SYMMETRIC" PRIMAL-DUAL PAIR

Systems Analysis in Construction

Chapter 5 Linear Programming (LP)

3. THE SIMPLEX ALGORITHM

END3033 Operations Research I Sensitivity Analysis & Duality. to accompany Operations Research: Applications and Algorithms Fatih Cavdur

UNIT-4 Chapter6 Linear Programming

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

F 1 F 2 Daily Requirement Cost N N N

OPERATIONS RESEARCH. Michał Kulej. Business Information Systems


Sensitivity Analysis

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

THE UNIVERSITY OF HONG KONG DEPARTMENT OF MATHEMATICS. Operations Research I

Linear Programming: Chapter 5 Duality

The Simplex Method. Formulate Constrained Maximization or Minimization Problem. Convert to Standard Form. Convert to Canonical Form

Dr. S. Bourazza Math-473 Jazan University Department of Mathematics

IE 400: Principles of Engineering Management. Simplex Method Continued

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

Linear Programming Duality

A Review of Linear Programming

Introduction. Very efficient solution procedure: simplex method.

OPRE 6201 : 3. Special Cases

Brief summary of linear programming and duality: Consider the linear program in standard form. (P ) min z = cx. x 0. (D) max yb. z = c B x B + c N x N

II. Analysis of Linear Programming Solutions

(includes both Phases I & II)

c) Place the Coefficients from all Equations into a Simplex Tableau, labeled above with variables indicating their respective columns

AM 121: Intro to Optimization

Linear Programming Redux

MATH2070 Optimisation

Sensitivity Analysis and Duality in LP

Part 1. The Review of Linear Programming

4.6 Linear Programming duality

56:171 Operations Research Fall 1998

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

MVE165/MMG631 Linear and integer optimization with applications Lecture 8 Discrete optimization: theory and algorithms

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

Introduction to linear programming using LEGO.

(includes both Phases I & II)

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

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

MAT016: Optimization

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

Linear Programming, Lecture 4

The dual simplex method with bounds

56:270 Final Exam - May

Midterm Review. Yinyu Ye Department of Management Science and Engineering Stanford University Stanford, CA 94305, U.S.A.

Section Notes 8. Integer Programming II. Applied Math 121. Week of April 5, expand your knowledge of big M s and logical constraints.

Relation of Pure Minimum Cost Flow Model to Linear Programming

LINEAR PROGRAMMING 2. In many business and policy making situations the following type of problem is encountered:

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

In Chapters 3 and 4 we introduced linear programming

Chapter 1: Linear Programming

Linear & Integer programming

A Parametric Simplex Algorithm for Linear Vector Optimization Problems

MVE165/MMG630, Applied Optimization Lecture 6 Integer linear programming: models and applications; complexity. Ann-Brith Strömberg

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

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

Introduction to Mathematical Programming

Review Questions, Final Exam

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.

Optimisation and Operations Research

Understanding the Simplex algorithm. Standard Optimization Problems.

CO350 Linear Programming Chapter 8: Degeneracy and Finite Termination

Transcription:

MVE165/MMG630, The simplex method; degeneracy; unbounded solutions; infeasibility; starting solutions; duality; interpretation Ann-Brith Strömberg 2012 03 16

Summary of the simplex method Optimality condition: The entering variable in a maximization (minimization) problem should have the largest positive (negative) marginal value (reduced cost). The entering variable determines a direction in which the objective value increases (decreases). If all reduced costs are negative (positive), the current basis is optimal. Feasibility condition: The leaving variable is the one with smallest nonnegative quotient. Corresponds to the constraint that is reached first

Simplex search for linear (minimization) programs (Ch. 4.6) 1. Initialization: Choose any feasible basis, construct the corresponding basic solution x 0, let t = 0 2. Step direction: Select a variable to enter the basis using the optimality condition (negative marginal value). Stop if no entering variable exists 3. Step length: Select a leaving variable using the feasibility condition (smallest non-negative quotient) 4. New iterate: Compute the new basic solution x t+1 by performing matrix operations. 5. Let t := t + 1 and repeat from 2

Degeneracy (Ch. 4.10) If the smallest nonnegative quotient is zero, the value of a basic variable will become zero in the next iteration The solution is degenerate The objective value will not improve in this iteration Risk: cycling around (non-optimal) bases Reason: a redundant constraint touches the feasible set Example: x 1 + x 2 6 x 2 3 x 1 + 2x 2 9 x 1, x 2 0

Degeneracy Typical objective function progress of the simplex method objective value iteration number Computation rules to prevent from infinite cycling: careful choices of leaving and entering variables In modern software: perturb the right hand side (b i + b i ), solve, reduce the perturbation and resolve starting from the current basis. Repeat until b i = 0.

Unbounded solutions (Ch. 4.4, 4.6) If all quotients are negative, the value of the variable entering the basis may increase infinitely The feasible set is unbounded In a real application this would probably be due to some incorrect assumption Example: minimize z = x 1 2x 2 subject to x 1 +x 2 2 2x 1 +x 2 1 x 1, x 2 0 Draw graph!!

Unbounded solutions (Ch. 4.4, 4.6) A feasible basis is given by x 1 = 1, x 2 = 3, with corresponding tableau: Homework: Find this basis using the simplex method. basis z x 1 x 2 s 1 s 2 RHS z 1 0 0 5-3 7 x 1 0 1 0 1-1 1 x 2 0 0 1 2-1 3 Entering variable is s 2 Row 1: x 1 = 1 + s 2 0 s 2 1 Row 2: x 2 = 3 + s 2 0 s 2 3 No leaving variable can be found, since no constraint will prevent s 2 from increasing infinitely

Starting solution finding an initial basis (Ch. 4.9) Example: minimize z = 2x 1 +3x 2 subject to 3x 1 +2x 2 = 14 2x 1 4x 2 2 Draw graph!! 4x 1 +3x 2 19 x 1,x 2 0 Add slack and surplus variables minimize z = 2x 1 +3x 2 subject to 3x 1 +2x 2 = 14 2x 1 4x 2 s 1 = 2 4x 1 +3x 2 +s 2 = 19 x 1,x 2,s 1,s 2 0 How finding an initial basis? Only s 2 is obvious!

Artificial variables Add artificial variables a 1 and a 2 to the first and second constraints, respectively Solve an artificial problem: minimize a 1 + a 2 minimize w = a 1 +a 2 subject to 3x 1 +2x 2 +a 1 = 14 2x 1 4x 2 s 1 +a 2 = 2 4x 1 +3x 2 +s 2 = 19 x 1,x 2,s 1,s 2,a 1,a 2 0 The phase one problem An initial basis is given by a 1 = 14, a 2 = 2, and s 2 = 19: basis w x 1 x 2 s 1 s 2 a 1 a 2 RHS w 1-5 2 1 0 0 0-16 a 1 0 3 2 0 0 1 0 14 a 2 0 2-4 -1 0 0 1 2 s 2 0 4 3 0 1 0 0 19

Find an initial solution using artificial variables x 1 enters a 2 leaves (then x 2 s 2, then s 1 a 1 ) basis w x 1 x 2 s 1 s 2 a 1 a 2 RHS w 1-5 2 1 0 0 0-16 a 1 0 3 2 0 0 1 0 14 a 2 0 2-4 -1 0 0 1 2 s 2 0 4 3 0 1 0 0 19 w 1 0-8 -1.5 0 0-11 a 1 0 0 8 1.5 0 1 11 x 1 0 1-2 -0.5 0 0 1 s 2 0 0 11 2 1 0 15 w 1 0 0-0.045 0.727 0-0.091 a 1 0 0 0 0.045-0.727 1 0.091 x 1 0 1 0-0.136 0.182 0 3.727 x 2 0 0 1 0.182 0.091 0 1.364 w 1 0 0 0 0 0 s 1 0 0 0 1-16 2 x 1 0 1 0 0-2 4 x 2 0 0 1 0 3 1 A feasible basis is given by x 1 = 4, x 2 = 1, and s 1 = 2

Infeasible linear programs (Ch. 4.9) If the solution to the phase one problem has optimal value = 0, a feasible basis has been found Start optimizing the original objective function z from this basis (homework) If the solution to the phase one problem has optimal value w > 0, no feasible solutions exist What would this mean in a real application? Alternative: Big-M method: Add the artificial variables to the original objective with a large coefficient Example: minimize z = 2x 1 + 3x 2 minimize z a = 2x 1 + 3x 2 + Ma 1 + Ma 2

Alternative optimal solutions (Ch. 4.6) Example: maximize z = 2x 1 +4x 2 subject to x 1 +2x 2 5 x 1 +x 2 4 Draw graph!! x 1,x 2 0 The extreme points (0, 5 2 ) and (3,1) have the same optimal value z = 10 All solutions that are positive linear (convex) combinations of these are optimal: (x 1,x 2 ) = α (0, 5 ) + (1 α) (3,1), 0 α 1 2

A general linear program in standard form A linear program with n non-negative variables, m equality constraints (m < n), and non-negative right hand sides: maximize z = subject to n c j x j j=1 n a ij x j j=1 On matrix form it is written as: = b i, i = 1,...,m, x j 0, j = 1,...,n. maximize z = c T x, subject to Ax = b, x 0 n, where x R n, A R m n, b R m + (b 0 m ), and c R n.

General derivation of the simplex method (Ch. 4.8) B = set of basic variables, N = set of non-basic variables B = m and N = n m Partition matrix/vectors: A=(B,N), x=(x B,x N ), c=(c B,c N ) The matrix B (N) contains the columns of A corresponding to the index set B (N) Analogously for x and c Rewrite the linear program: maximize z = c T x maximize z = c T B x B + c T N x N subject to Ax = b, = subject to Bx B + Nx N = b, x 0 n x B 0 m, x N 0 n m Substitute: x B = B 1 b B 1 Nx N = maximize z = c T B B 1 b + [c T N ct B B 1 N]x N subject to B 1 b B 1 Nx N 0 m, x N 0 n m

Optimality and feasibility Optimality condition (for maximization) The basis B is optimal if c T N ct B B 1 N 0 n m (marginal values = reduced costs 0) If not, choose as entering variable j N the one with the largest value of the reduced cost c j c T B B 1 A j Feasibility condition For all i B it holds that x i = (B 1 b) i (B 1 A j ) i x j Choose the leaving variable i B according to { (B i 1 } b) i = arg min i B (B 1 A j ) i (B 1 A j ) i > 0

In the simplex tableau, we have basis z x B x N s RHS z 1 0 c T N ct B B 1 N c T B B 1 c T B B 1 b x B 0 I B 1 N B 1 B 1 b s denotes possible slack variables (columns for s are copies of certain columns for (x B,x N )) The computations performed by the simplex algorithm involve matrix inversions and updates of these A non-basic (basic) variable enters (leaves) the basis one column, A j, of B is replaced by another, A k Row operations Updates of B 1 (and B 1 N, B 1 b, and c T B B 1 ) Efficient numerical computations are crucial for the performance of the simplex algorithm

Intuitive derivation of duality (Ch. 6.1) A linear program with optimal value z maximize z := 20x 1 +18x 2 weights subject to 7x 1 +10x 2 3600 (1) v 1 16x 1 +12x 2 5400 (2) v 2 x 1,x 2 0 How large can z be? Compute upper estimates of z, e.g. Multiply (1) by 3 21x1 + 30x 2 10800 z 10800 Multiply (2) by 1.5 24x1 + 18x 2 8100 z 8100 Combine: 0.6 (1)+1 (2) 20.2x1 +18x 2 7560 z 7560 Do better than guess compute optimal weights! Value of estimate: w = 3600v 1 + 5400v 2 min 7v 1 + 16v 2 20 Constraints on weights: 10v 1 + 12v 2 18 v 1,v 2 0

The best (lowest) possible upper estimate of z minimize w := 3600v 1 + 5400v 2 subject to 7v 1 + 16v 2 20 10v 1 + 12v 2 18 v 1,v 2 0 A linear program! It is called the dual of the original linear program

The lego model the market problem Consider the lego problem maximize z = 1600x 1 + 1000x 2 subject to 2x 1 + x 2 6 2x 1 + 2x 2 8 x 1, x 2 0 Option: Sell bricks instead of making furniture v 1 (v 2 ) = price of a large (small) brick Market wish to minimize payment: minimize 6v 1 + 8v 2 I sell if prices are high enough: 2v1 + 2v 2 1600 otherwise better to make tables v1 + 2v 2 1000 otherwise better to make chairs v1, v 2 0 prices are naturally non-negative

Linear programming duality To each primal linear program corresponds a dual linear program [Primal] minimize z = c T x, subject to Ax = b, x 0 n, [Dual] maximize w = b T y, subject to A T y c. On component form: [Primal] minimize z = n j=1 c jx j subject to n j=1 a ijx j = b i, i = 1,...,m, x j 0, j = 1,...,n, [Dual] maximize w = n j=1 b iy i subject to m i=1 a ijy i c j, j = 1,...,n.

An example A primal linear program minimize z = 2x 1 +3x 2 subject to 3x 1 +2x 2 = 14 2x 1 4x 2 2 4x 1 +3x 2 19 x 1,x 2 0 The corresponding dual linear program maximize w = 14y 1 +2y 2 +19y 3 subject to 3y 1 +2y 2 +4y 3 2 2y 1 4y 2 +3y 3 3 y 1 free, y 2 0, y 3 0

Rules for constructing the dual program (Ch. 6.2) maximization minimization dual program primal program primal program dual program constraints variables 0 0 = free variables constraints 0 0 free = The dual of the dual of any linear program equals the primal

Duality properties (Ch. 6.3) Weak duality: Let x be a feasible point in the primal (minimization) and y be a feasible point in the dual (maximization). Then, z = c T x b T y = w Strong duality: In a pair of primal and dual linear programs, if one of them has an optimal solution, so does the other, and their optimal values are equal. Complementary slackness: If x is optimal in the primal and y is optimal in the dual, then x T (c A T y) = y T (b Ax) = 0. If x is feasible in the primal, y is feasible in the dual, and x T (c A T y) = y T (b Ax) = 0, then x and y are optimal for their respective problems.

Relations between primal and dual optimal solutions primal (dual) problem dual (primal) problem unique and unique and non-degenerate solution non-degenerate solution unbounded solution = no feasible solutions no feasible solutions = unbounded solution or no feasible solutions degenerate solution alternative solutions

Exercises on duality Homework! Formulate and solve graphically the dual of: minimize z = 6x 1 +3x 2 +x 3 subject to 6x 1 3x 2 +x 3 2 3x 1 +4x 2 +x 3 5 x 1,x 2,x 3 0 Then find the optimal primal solution Verify that the dual of the dual equals the primal