Simplex Method Continued …

Slides:



Advertisements
Similar presentations
February 21, 2002 Simplex Method Continued
Advertisements

February 14, 2002 Putting Linear Programs into standard form
Linear Programming – Simplex Method
Dr. Sana’a Wafa Al-Sayegh
Degeneracy and the Convergence of the Simplex Algorithm LI Xiao-lei.
Lecture 15 Special cases by Dr. Arshad Zaheer
Linear Inequalities and Linear Programming Chapter 5
Computational Methods for Management and Economics Carla Gomes Module 6b Simplex Pitfalls (Textbook – Hillier and Lieberman)
The Simplex Method: Standard Maximization Problems
CS38 Introduction to Algorithms Lecture 15 May 20, CS38 Lecture 15.
5.5 Solution Possibilities
Design and Analysis of Algorithms
Solving Linear Programs: The Simplex Method
Chapter 10: Iterative Improvement
Linear Programming (LP)
The Simplex Method.
MIT and James Orlin © Chapter 3. The simplex algorithm Putting Linear Programs into standard form Introduction to Simplex Algorithm.
The Simplex algorithm.
OR Chapter 3. Pitfalls OR  Selection of leaving variable: a)No restriction in minimum ratio test : can increase the value of the entering.
The Two-Phase Simplex Method LI Xiao-lei. Preview When a basic feasible solution is not readily available, the two-phase simplex method may be used as.
8. Linear Programming (Simplex Method) Objectives: 1.Simplex Method- Standard Maximum problem 2. (i) Greedy Rule (ii) Ratio Test (iii) Pivot Operation.
Simplex method (algebraic interpretation)
1 Linear programming Linear program: optimization problem, continuous variables, single, linear objective function, all constraints linear equalities or.
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.
The Simplex Method Updated 15 February Main Steps of the Simplex Method 1.Put the problem in Row-Zero Form. 2.Construct the Simplex tableau. 3.Obtain.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
OR Perturbation Method (tableau form) (after two iterations, optimal solution obtained) (0+2  1 ) (0+2  2 ) (1+  3 )
1. 2 Computing the Adjoint matrix: 3 Assignment #3 is available. Due: Monday Nov. 5, beginning of class.
Linear Programming Revised Simplex Method, Duality of LP problems and Sensitivity analysis D Nagesh Kumar, IISc Optimization Methods: M3L5.
3.3 Implementation (1) naive implementation (2) revised simplex method
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 Programming Implementation. Linear Programming
Chapter 3 Linear Programming Methods
1 Chapter 4 The Simplex Algorithm PART 2 Prof. Dr. M. Arslan ÖRNEK.
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.
MIT and James Orlin © Chapter 3. The simplex algorithm Putting Linear Programs into standard form Introduction to Simplex Algorithm file Simplex2_AMII_05a_gr.
OR Chapter 7. The Revised Simplex Method  Recall Theorem 3.1, same basis  same dictionary Entire dictionary can be constructed as long as we.
An-Najah N. University Faculty of Engineering and Information Technology Department of Management Information systems Operations Research and Applications.
The Simplex Algorithm 虞台文 大同大學資工所 智慧型多媒體研究室. Content Basic Feasible Solutions The Geometry of Linear Programs Moving From Bfs to Bfs Organization of a.
Simplex Method Simplex: a linear-programming algorithm that can solve problems having more than two decision variables. The simplex technique involves.
1. 2 We studying these special cases to: 1- Present a theoretical explanation of these situations. 2- Provide a practical interpretation of what these.
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.
OR  Now, we look for other basic feasible solutions which gives better objective values than the current solution. Such solutions can be examined.
Simplex Method Review. Canonical Form A is m x n Theorem 7.5: If an LP has an optimal solution, then at least one such solution exists at a basic feasible.
Foundations-1 The Theory of the Simplex Method. Foundations-2 The Essence Simplex method is an algebraic procedure However, its underlying concepts are.
MTH374: Optimization For Master of Mathematics By Dr. M. Fazeel Anwar Assistant Professor Department of Mathematics, CIIT Islamabad 1.
1 Simplex algorithm. 2 The Aim of Linear Programming A Linear Programming model seeks to maximize or minimize a linear function, subject to a set of linear.
Decision Support Systems INF421 & IS Simplex: a linear-programming algorithm that can solve problems having more than two decision variables.
Chapter 4 The Simplex Algorithm and Goal Programming
The Simplex Method. and Maximize Subject to From a geometric viewpoint : CPF solutions (Corner-Point Feasible) : Corner-point infeasible solutions 0.
1 Two-Phase Simplex Method file Simplex3_AMII_05b_gr Rev. 1.4 by M. Miccio on December 17, 2014 from a presentation at the Fuqua School of Business MIT.
EMGT 6412/MATH 6665 Mathematical Programming Spring 2016
Linear Programming Revised Simplex Method, Duality of LP problems and Sensitivity analysis D Nagesh Kumar, IISc Optimization Methods: M3L5.
Chap 10. Sensitivity Analysis
Perturbation method, lexicographic method
Chapter 4 Linear Programming: The Simplex Method
Chapter 5. Sensitivity Analysis
Chap 3. The simplex method
Chapter 8. General LP Problems
ISyE 4231: Engineering Optimization
Chapter 8. General LP Problems
Chapter 10: Iterative Improvement
Chapter 8. General LP Problems
Practical Issues Finding an initial feasible solution Cycling
Chapter 3. Pitfalls Initialization Ambiguity in an iteration
Presentation transcript:

Simplex Method Continued … from a presentation at the Fuqua School of Business MIT and James Orlin © 2003 Rev. 2.71 by M. Miccio on December 15, 2014 MIT and James Orlin © 2003 file Simplex2_AMII_05b_gr 1

Today’s Lecture Review of the simplex algorithm Alternative Optimal Solutions Unbounded Solution Degeneracy Is the simplex algorithm finite? (Answer, yes, but only if we are careful) MIT and James Orlin © 2003 2

Today’s Lecture Review of the simplex algorithm Alternative Optimal Solutions Unbounded Solution Degeneracy Is the simplex algorithm finite? (Answer, yes, but only if we are careful) MIT and James Orlin © 2003 3

Review of the Notation n number of variables m number of constraints c index of entering variable r index of pivot row note: the rth basic variable leaves the basis The original data is cj, aij, bi After performing pivots we represent the revised coefficients as cj, aij, bi The bar − indicates that it is the coefficient after some pivots MIT and James Orlin © 2003 4

m constraints, n variables Tableau Basic Variables Non-basic Variables -z x1 x2 xr xm xm+1 xs xn CV 1 cm+1 cs cn -z0 = 1 a1,m+1 a1,s a1,n b1 = 1 a2,m+1 a2,s a2,n b2 . . . . . = 1 ar,m+1 ar,s ar,n br = . . . . . 1 am,m+1 am,s am,n bm = m constraints, n variables MIT and James Orlin © 2003 5

The basic feasible solution The current values are all non-negative. This is needed for canonical form There is a basic variable associated with each constraint. in this Tableau, the basic variable associated with constraint i is xi. There are (n-m) nonbasic variables. In this Tableau, the nonbasic variables are xm+1, … xn. This bfs is as follows: x1 =b1, … , xm =bm. All other variables are 0. MIT and James Orlin © 2003 6

Today’s Lecture Review of the simplex algorithm. Alternative Optimal Solutions Unbounded Solution Degeneracy Degenerate Solutions Proving finiteness and optimality under no degeneracy MIT and James Orlin © 2003 7

Alternative Optima (maximization) Initial Tableau z = 0x1 -4x2 + 8 max! How much can x1 be increased? -z x1 x2 x3 x4 1 -4 -8 = 1 3 1 6 = -1 2 1 2 This basic feasible solution is optimal! Is there another optimal solution? Suppose that x1 entered the basis. What would leave? MIT and James Orlin © 2003 8

Alternative Optima (maximization) Initial Tableau 1 c1 c2 -4 -8 = 1 3 1 6 = -1 2 1 2 Use the min ratio rule to select the pivot row and to determine which variable leaves the basis. MIT and James Orlin © 2003 9

Alternative Optima (maximization) Tableau No.1 -4 -4 -8 -8 = 1 1 3 3 1 1 6 6 = -1 2 5 1 1 1 8 2 Let x1 enter the basis. Let the basic variable in constraint 1 leave the basis. Note: the solution is different, but the objective function value is the same. MIT and James Orlin © 2003 10

Test for infinite solutions Alternative Optima Test for infinite solutions There are alternative optima ifcj = 0 for some j where xj is non-basic MIT and James Orlin © 2003 11

Today’s Lecture Review of the simplex algorithm. Alternative Optimal Solutions Unbounded Solution Degeneracy Degenerate Solutions Proving finiteness and optimality under no degeneracy MIT and James Orlin © 2003 12

Unboundedness z = 1x1+ 0x2 + 2 max! -z x1 x2 x3 x4 1 -2 1 -3 1 -1 1 -1 1 -2 3 = x1 = 0 x2 = 1 x3 = 3 x4 = 0 z = 2 x1 = D x2 = 1 − (-2)D x3 = 3 − (-3)D x4 = 0 z = 2 + D -3 1 -1.5 = -2 1 .5 Verif. Cosa succede per a21 = +2 The entry variable is x1. Set x1 = D>0 while x4 = 0. D can be as large as we like ! If all the coefficients in the entering column are  0, then the solution is unbounded from above MIT and James Orlin © 2003 13

Unboundedness Test for Unbounded Solution If aic  0 for all i, then the solution is unbounded. MIT and James Orlin © 2003 14

Simplex Algorithm step by step (Search for Max) Step 0. The problem is in canonical form withb  0. Step 1. If c  0 then stop. The solution is optimal. If there exists some cj>0, then we continue. Step 2. Choose any non-basic variable to pivot in with cs > 0, e.g., cs = maxj {cj | cj > 0 }. If ais  0 for all i, then stop; the LP is unbounded. If we continue, then there exists some ais > 0. Step 3. Pivot out the basic variable in row r, where r is chosen by the min ratio rule, that is r = argmini (bi/ais : ais > 0 ). Step 4. Replace the basic variable in row r with variable xs and re-establish canonical form (i.e., pivot on the coefficient ars) Step 5. Go back to Step 1. MIT and James Orlin © 2003 15

Today’s Lecture Review of the simplex algorithm. Alternative Optimal Solutions Unbounded Solution Degeneracy and Degenerate Solutions Proving finiteness and optimality under no degeneracy MIT and James Orlin © 2003 16

Degeneracy Initial Tableau BV -z x1 x2 x3 x4 -z 1 -3 2 -2 = x3 -3 3 1 1 6 = x4 -4 2 1 2 A bfs is degenerate if the Tableau revealsbi = 0 for some i. Otherwise, it is non-degenerate. This bfs is degenerate. MIT and James Orlin © 2003 17

Degeneracy 3 BV -z x1 x2 x3 x4 -z 1 -3 2 -2 = x3 -3 3 1 1 6 = x4 -4 2 -2 = x3 -3 3 1 1 6 = x4 -4 2 1 3 3 2 A bfs is degenerate if the Tableau revealsbi = 0 for some i. Otherwise, it is non-degenerate. This bfs is non-degenerate. MIT and James Orlin © 2003 18

Degeneracy BV -z x1 x2 x3 x4 -z 1 -3 2 -2 = x1 = 0 x2 = D x3 = 6 - 3D x4 = 0 - 2D z = 2 + 2D x3 -3 3 1 1 6 = x4 -4 2 1 2 Suppose that variable x2 will enter the basis. Degenerate  the solution may stay the same  z stays the same MIT and James Orlin © 2003 19

A degenerate pivoting Tableau No.1 BV -z x1 x2 x3 x4 -z 1 -3 1 2 -1 -2 -2 = x1 = 0 x2 = 0 x3 = 6 x4 = 0 z = 2 x3 -3 3 3 1 1 1 -3/2 6 6 = x4 -2 -4 1 2 1 1/2 The entering variable is x2, which takes a zero value. The exiting variable is the one in constraint 2. In this case the objective function did not change. (But the tableau did !) MIT and James Orlin © 2003 20

Cycling Problem: Solution: if one of the basic variables is zero: Xi = 0 + … a pivot could be performed which does not change the corresponding value of the objective function  danger of pivoting back (“cycling”) Solution: use e.g. Bland’s anti-cycling rule: always select the candidate pivot column with smallest index, i.e., the leftmost in Tableau (e.g., x2 instead of x4) if several rows have the same minimum ratio, choose for pivoting the first one (i.e., topmost) of them this is alternative to the pivot column selection rule that was previously discussed The Simplex Algorithm 11 November, 2002 21

Degeneracy Test for Degeneracy The next bfs will be degenerate ! The Simplex Algorithm 11 November, 2002 22

Non-degeneracy leads to strict improvement BV -z x1 x2 x3 x4 -z 1 -3 2 -2 = x1 = 0 x2 = D x3 = 6 - 3D x4 = 2 - 2D z = 2+ 2D x3 -3 3 1 1 6 = x4 -4 2 1 2 If the bfs is non-degenerate, then the entering variable can strictly increase, and the objective value will strictly improve. MIT and James Orlin © 2003 23

Cycling Alternative to Bland’s anti-cycling rule Perturb the RHS just a little, in just the right way No basis is degenerate Every bfs to the perturbed problem is also a bfs for the original problem The optimal basis for the perturbed problem is optimal for the original problem MIT and James Orlin © 2003 24

An LP before perturbation Initial Tableau BV -z x1 x2 x3 x4 -z 1 -3 2 = x3 -3 3 1 1 6. = x4 -4 2 1 2. Goal: modify the problem by changing the RHS just a little Perturb it to avoid degeneracy Perturb it so little that solving the perturbed problem also solves the original problem. MIT and James Orlin © 2003 25

An example of a perturbed initial bfs BV -z x1 x2 x3 x4 -z 1 -3 2 = x3 -3 3 1 1 6.00000000000013 = x4 -4 2 1 2.00000000000041 In theory perturbations are even smaller In practice, the simplex method works fine without perturbations, that is, it really obtains the optimum basic feasible solution. MIT and James Orlin © 2003 26

Today’s Lecture Review of the simplex algorithm. Alternative Optimal Solutions Unbounded Solution Degeneracy Degenerate Solutions Proving finiteness and optimality under no degeneracy MIT and James Orlin © 2003 27

Theorem: If every feasible basic solution is non-degenerate, the simplex method is finite. The number of feasible basic solutions is at most n! / (n-m)! m! which is the number of ways of selecting m basic variables Each feasible basic solution is different Each has a better cost than the last, assuming non-degeneracy Therefore, the simplex method is finite Typical number of iterations is between m and 3m. Number of operations per iteration: O(nm) MIT and James Orlin © 2003 28

Some Remarks on Degeneracy and Alternative Optima It might seem that degeneracy would be rare. After all, why should we expect that the RHS would be 0 for some variable? In reality, degeneracy is incredibly common. The simplex method is not necessarily finite unless care is taken in the pivot rule. In reality, almost no one takes care, and the simplex method is not only finite, but it is incredibly efficient. The issue of alternative optima arises frequently, and is of importance in practice. MIT and James Orlin © 2003 29

Software for Simplex implementation and solution

Demonstration Example Maximize the Objective Function (P) P = 15 x1 + 10 x2 subject to: L1: 0.25 x1 + 1.0 x2 <= 65 L2: 1.25 x1 + 0.5 x2 <= 90 L3: 1.0 x1 + 1.0 x2 <= 85       x1 >= 0; x2 >= 0 Solved step-by-step on Operations Research-Linear Programming-Simplex Algorithm by Elmer G. Wiens http://www.egwald.ca/operationsresearch/lpsimplex.php MIT and James Orlin © 2003 31

Demonstration Simplex solver Solved step-by-step Tableau and Final Solution on Finite mathematics utility: simplex method tool http://www.zweigmedia.com/RealWorld/simplex.html MIT and James Orlin © 2003 32

SIMPLEX with MatLab® function simplex2p(type, c, A, rel, b) LINEAR PROGRAMMING WITH MATLAB course by Edward Neuman Department of Mathematics Southern Illinois University at Carbondale function simplex2p(type, c, A, rel, b) % The Two-Phase Method for solving the LP problem % implements the Bland’s rule to avoid cycling in case of degeneracy % % min (max) z = c*x % subject to Ax rel b % x >= 0 . . . % input data type = ‘min’ (OR ‘max’) % simplex2p always searches for MIN! c = [c1 c2 ... ck] % is a row vector A = [a11 a12 … a1k; ... ; am1 am2 … amk] rel = ‘<<< … >>> … ===‘ b = [b1; b2; ... bm] % must be a column vector

Exercise 5 (for home) with contraints of type ≤ z = 3x1 + 2x2 - x3 + x4 max ! x1 + 2x2 + x3 - x4  5 inequality 2x1 + 4x2 + x3 + x4  1 inequality x1  0, x2  0, x3  0 non-negativity x4 uncostrained in sign