Solving Linear Programs: The Simplex Method

Slides:



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

Hillier and Lieberman Chapter 4.
Operation Research Chapter 3 Simplex Method.
Linear Programming – Simplex Method
Chapter 6 Linear Programming: The Simplex Method
Solving Linear Programming Problems: The Simplex Method
Dr. Sana’a Wafa Al-Sayegh
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc
Computational Methods for Management and Economics Carla Gomes Module 6a Introduction to Simplex (Textbook – Hillier and Lieberman)
Water Resources Development and Management Optimization (Linear Programming) CVEN 5393 Feb 18, 2013.
Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method.
Linear Programming Fundamentals Convexity Definition: Line segment joining any 2 pts lies inside shape convex NOT convex.
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
Operation Research Chapter 3 Simplex Method.
DMOR Linear Programming.
Design and Analysis of Algorithms
Optimization Mechanics of the Simplex Method
Linear Programming (LP)
The Simplex Method.
5.6 Maximization and Minimization with Mixed Problem Constraints
MIT and James Orlin © Chapter 3. The simplex algorithm Putting Linear Programs into standard form Introduction to Simplex Algorithm.
Water Resources Development and Management Optimization (Linear Programming) CVEN 5393 Feb 25, 2013.
LINEAR PROGRAMMING SIMPLEX METHOD.
The Simplex algorithm.
Chapter 6 Linear Programming: The Simplex Method
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.
Simplex method (algebraic interpretation)
Some Key Facts About Optimal Solutions (Section 14.1) 14.2–14.16
Chapter 6 Linear Programming: The Simplex Method Section 2 The Simplex Method: Maximization with Problem Constraints of the Form ≤
ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March
Chapter 3. Pitfalls Initialization Ambiguity in an iteration
Topic III The Simplex Method Setting up the Method Tabular Form Chapter(s): 4.
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.
Public Policy Modeling Simplex Method Tuesday, October 13, 2015 Hun Myoung Park, Ph.D. Public Management & Policy Analysis Program Graduate School of International.
1© 2003 by Prentice Hall, Inc. Upper Saddle River, NJ Linear Programming: The Simplex Method.
Simplex Method Adapting to Other Forms.  Until now, we have dealt with the standard form of the Simplex method  What if the model has a non-standard.
Solving Linear Programming Problems: The Simplex Method
Business Mathematics MTH-367 Lecture 15. Chapter 11 The Simplex and Computer Solutions Methods continued.
Linear Programming Erasmus Mobility Program (24Apr2012) Pollack Mihály Engineering Faculty (PMMK) University of Pécs João Miranda
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
Chapter 3 Linear Programming Methods
McGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., Table of Contents CD Chapter 14 (Solution Concepts for Linear Programming) Some Key Facts.
1 Chapter 4 The Simplex Algorithm PART 2 Prof. Dr. M. Arslan ÖRNEK.
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.
University of Colorado at Boulder Yicheng Wang, Phone: , Optimization Techniques for Civil and Environmental Engineering.
An-Najah N. University Faculty of Engineering and Information Technology Department of Management Information systems Operations Research and Applications.
Simplex Method Simplex: a linear-programming algorithm that can solve problems having more than two decision variables. The simplex technique involves.
Business Mathematics MTH-367 Lecture 16. Chapter 11 The Simplex and Computer Solutions Methods continued.
Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc. Linear Programming: An Algebraic Approach 4 The Simplex Method with Standard Maximization.
Foundations-1 The Theory of the Simplex Method. Foundations-2 The Essence Simplex method is an algebraic procedure However, its underlying concepts are.
Decision Support Systems INF421 & IS Simplex: a linear-programming algorithm that can solve problems having more than two decision variables.
(iii) Simplex method - I D Nagesh Kumar, IISc Water Resources Planning and Management: M3L3 Linear Programming and Applications.
The Simplex Method. and Maximize Subject to From a geometric viewpoint : CPF solutions (Corner-Point Feasible) : Corner-point infeasible solutions 0.
EMGT 6412/MATH 6665 Mathematical Programming Spring 2016
Solving Linear Program by Simplex Method The Concept
Perturbation method, lexicographic method
10CS661 OPERATION RESEARCH Engineered for Tomorrow.
10CS661 OPERATION RESEARCH Engineered for Tomorrow.
Chapter 4 Linear Programming: The Simplex Method
ENGM 631 Optimization Ch. 4: Solving Linear Programs: The Simplex Method.
Solving Linear Programming Problems: Asst. Prof. Dr. Nergiz Kasımbeyli
Well, just how many basic
Presentation transcript:

Solving Linear Programs: The Simplex Method

The Essence Simplex method is an algebraic procedure However, its underlying concepts are geometric Understanding these geometric concepts helps before going into their algebraic equivalents

Back to Wyndor Glass Constraint boundaries Feasible region Corner-point solutions Corner-point feasible (CPF) solutions Adjacent CPF solutions Edges of the feasible region Optimality test in the Simplex Method: If a CPF solution has no adjacent solutions that are better, then it must be an optimal solution X2 (0,9) (0,6) (2,6) (4,6) (4,3) (0,0) (4,0) (6,0) X1

The Simplex Method in a Nutshell An iterative procedure Initialization (Find initial CPF solution) Is the current CPF solution optimal? Yes Stop No Move to a better adjacent CPF solution

Solving Wyndor Glass Initial CPF Optimality test If not optimal, then move to a better adjacent CPF solution: Consider the edges that emanate from current CPF Move along the edge that increases Z at a faster rate Stop at the first constraint boundary Solve for the intersection of the new boundaries Back to optimality test X2 (0,6) Z=30 (2,6) Z=36 (4,3) Z=27 (0,0) Z=0 (4,0) Z=12 X1

Key Concepts Focus only on CPF solutions An iterative algorithm If possible, use the origin as the initial CPF solution Move always to adjacent CPF solutions Don’t calculate the Z value at adjacent solutions, instead move directly to the one that ‘looks’ better (on the edge with the higher rate of improvement) Optimality test also looks at the rate of improvement (If all negative, then optimal)

‘Language’ of the Simplex Method

Initial Assumptions All constraints are of the form ≤ All right-hand-side values (bj, j=1, …,m) are positive We’ll learn how to address other forms later

The Augmented Form Set up the method first: Convert inequality constraints to equality constraints by adding slack variables Augmented Form Maximize Z = 3x1+ 5x2 subject to x1 +s1 = 4 2x2 = 12 3x1+ 2x2 = 18 x1,x2 ≥ 0 Original Form Maximize Z = 3x1+ 5x2 subject to x1 ≤ 4 2x2 ≤ 12 3x1+ 2x2 ≤ 18 x1,x2 ≥ 0

Basic and Basic Feasible Solutions X2 Augmented Form Maximize Z = 3x1+ 5x2 subject to x1 +s1 = 4 2x2 +s2 = 12 3x1+ 2x2 +s3 = 18 x1,x2, s1, s2, s3 ≥ 0 (0,9,4,-6,0) (0,6,4,0,6) (2,6,2,0,0) (4,6,0,0,-6) Augmented solution Basic infeasible solution Basic feasible solution (BFS) Nonbasic feasible solution (2,3,2,6,6) (4,3,0,6,0) (0,2,4,8,14) (0,0,4,12,18) (4,0,0,12,6) (6,0,-2,12,0) X1

Basic, Nonbasic Solutions and the Basis In an LP, number of variables > number of equations The difference is the degrees of freedom of the system e.g. in Wyndor Glass, degrees of freedom (d.f.)= Can set some variables (# = d.f.) to an arbitrary value (simplex uses 0) These variables (set to 0) are called nonbasic variables The rest can be found by solving the remaining system The basis: the set of basic variables If all basic variables are ≥ 0, we have a BFS Between two basic solutions, if their bases are the same except for one variable, then they are adjacent

Basis Examples: Wyndor Glass Maximize Z = 3x1+ 5x2 subject to x1 +s1 = 4 2x2 +s2 = 12 3x1+ 2x2 +s3 = 18 x1,x2, s1, s2, s3 ≥ 0 If the basis was: (x1,x2,s1) → (x1,x2,s2) → (s1,s2,s3) → Which ones are BFS? Which pairs are adjacent?

Algebra of the Simplex Method Initialization Maximize Z = 3x1+ 5x2 subject to x1 +s1 = 4 2x2 +s2 = 12 3x1+ 2x2 +s3 = 18 x1,x2, s1, s2, s3 ≥ 0 Find an initial basic feasible solution Remember from key concepts: “If possible, use the origin as the initial CPF solution” Equivalent to: Choose original variables to be nonbasic (xi=0, i=1,…n) and let the slack variables be basic (sj=bj, j=1,…m))

Algebra of the Simplex Method Optimality Test Maximize Z = 3x1+ 5x2 subject to x1 +s1 = 4 2x2 +s2 = 12 3x1+ 2x2 +s3 = 18 x1,x2, s1, s2, s3 ≥ 0 Are any adjacent BF solutions better than the current one? Rewrite Z in terms of nonbasic variables and investigate rate of improvement Current nonbasic variables: Corresponding Z: Optimal?

Algebra of the Simplex Method Step 1 of Iteration 1: Direction of Movement Maximize Z = 3x1+ 5x2 subject to x1 +s1 = 4 2x2 +s2 = 12 3x1+ 2x2 +s3 = 18 x1,x2, s1, s2, s3 ≥ 0 Which edge to move on? Determine the direction of movement by selecting the entering variable (variable ‘entering’ the basis) Choose the direction of steepest ascent x1: Rate of improvement in Z = x2: Rate of improvement in Z = Entering basic variable =

Algebra of the Simplex Method Step 2 of Iteration 1: Where to Stop Maximize Z = 3x1+ 5x2 subject to x1 +s1 = 4 (1) 2x2 +s2 = 12 (2) 3x1+ 2x2 +s3 = 18 (3) x1,x2, s1, s2, s3 ≥ 0 How far can we go? Determine where to stop by selecting the leaving variable (variable ‘leaving’ the basis) Increasing the value of x2 decreases the value of basic variables The minimum ratio test Constraint (1): Constraint (2): Constraint (3): Leaving basic variable =

Algebra of the Simplex Method Step 3 of Iteration 1: Solving for the New BF Solution Z - 3x1- 5x2 = 0 (0) x1 +s1 = 4 (1) 2x2 +s2 = 12 (2) 3x1+ 2x2 +s3 = 18 (3) Convert the system of equations to a more proper form for the new BF solution Elementary algebraic operations: Gaussian elimination Eliminate the entering basic variable (x2) from all but its equation

Algebra of the Simplex Method Optimality Test Z - 3x1+ + 5/2 s2 = 30 (0) x1 +s1 = 4 (1) x2 + 1/2 s2 = 6 (2) 3x1 - s2 + s3 = 6 (3) Are any adjacent BF solutions better than the current one? Rewrite Z in terms of nonbasic variables and investigate rate of improvement Current nonbasic variables: Corresponding Z: Optimal?

Algebra of the Simplex Method Step 1 of Iteration 2: Direction of Movement Z - 3x1+ + 5/2 s2 = 30 (0) x1 +s1 = 4 (1) x2 + 1/2 s2 = 6 (2) 3x1 - s2 + s3 = 6 (3) Which edge to move on? Determine the direction of movement by selecting the entering variable (variable ‘entering’ the basis) Choose the direction of steepest ascent x1: Rate of improvement in Z = s2: Rate of improvement in Z = Entering basic variable =

Algebra of the Simplex Method Step 2 of Iteration 2: Where to Stop Z - 3x1+ + 5/2 s2 = 30 (0) x1 +s1 = 4 (1) x2 + 1/2 s2 = 6 (2) 3x1 - s2 + s3 = 6 (3) How far can we go? Determine where to stop by selecting the leaving variable (variable ‘leaving’ the basis) Increasing the value of x1 decreases the value of basic variables The minimum ratio test Constraint (1): Constraint (2): Constraint (3): Leaving basic variable =

Algebra of the Simplex Method Step 3 of Iteration 2: Solving for the New BF Solution Z - 3x1+ + 5/2 s2 = 30 (0) x1 +s1 = 4 (1) x2 + 1/2 s2 = 6 (2) 3x1 - s2 + s3 = 6 (3) Convert the system of equations to a more proper form for the new BF solution Elementary algebraic operations: Gaussian elimination Eliminate the entering basic variable (x1) from all but its equation

Algebra of the Simplex Method Optimality Test Z + 3/2 s2 + s3 = 36 (0) +s1 + 1/3 s2 - 1/3 s3 = 2 (1) x2 + 1/2 s2 = 6 (2) x1 - 1/3 s2 + 1/3 s3 = 2 (3) Are any adjacent BF solutions better than the current one? Rewrite Z in terms of nonbasic variables and investigate rate of improvement Current nonbasic variables: Corresponding Z: Optimal?

The Simplex Method in Tabular Form For convenience in performing the required calculations Record only the essential information of the (evolving) system of equations in tableaux Coefficients of the variables Constants on the right-hand-sides Basic variables corresponding to equations

Wyndor Glass Convert to initial tableau Z x1 x2 s1 s2 s3 Basic variable Z x1 x2 s1 s2 s3 r.h.s.

Wyndor Glass, Iteration 1 Basic variable Z x1 x2 s1 s2 s3 r.h.s. 1 -3 -5 4 2 12 3 18 Optimality test Entering variable (steepest ascent) – pivot column Leaving variable (minimum ratio test) – pivot row Gaussian elimination Basic variable Z x1 x2 s1 s2 s3 r.h.s. 1

Wyndor Glass, Iteration 2 Basic variable Z x1 x2 s1 s2 s3 r.h.s. 1 -3 5/2 30 4 1/2 6 3 -1 Optimality test Entering variable (steepest ascent) – pivot column Leaving variable (minimum ratio test) – pivot row Gaussian elimination Basic variable Z x1 x2 s1 s2 s3 r.h.s. 1

Wyndor Glass, Iteration 3 Basic variable Z x1 x2 s1 s2 s3 r.h.s. 1 3/2 36 1/3 -1/3 2 1/2 6 Optimality test Entering variable (steepest ascent) – pivot column Leaving variable (minimum ratio test) – pivot row Gaussian elimination Basic variable Z x1 x2 s1 s2 s3 r.h.s. 1

Special Cases, Example 1 Z x1 x2 s1 Z x1 x2 s1 Basic variable r.h.s.

Special Cases, Example 2 Z x1 x2 s1 s2 s3 Z x1 x2 s1 s2 s3 Basic variable Z x1 x2 s1 s2 s3 r.h.s. Basic variable Z x1 x2 s1 s2 s3 r.h.s.

Special Cases, Example 2, cont’d Basic variable Z x1 x2 s1 s2 s3 r.h.s. Basic variable Z x1 x2 s1 s2 s3 r.h.s.

Special Cases, Example 3 Z x1 x2 s1 s2 s3 Basic variable r.h.s.

Special Cases, Example 4 Z x1 x2 s1 s2 s3 Basic variable r.h.s.

Special Cases, Summary If no variable qualifies to be the leaving variable, then the LP is unbounded If the Z-row coefficient of a nonbasic variable is zero, the variable may enter the basis, however the objective function will not change If, in addition, coefficients of all other nonbasic variables are  0, then there are multiple optimal solutions If there is a tie for the entering variable, break it arbitrarily It will only affect the path taken, but the same optimal solution will be reached If there is a tie for the leaving variable, theoretically the way in which the tie is broken is important The method can get trapped in an infinite loop (cycling under degeneracy) Beyond the scope of this class

Other Problem Forms Until now, we assumed Only constraints of the form  Only positive right-hand-side values (bj  0) Non-negativity We relaxed the maximization assumption earlier: min cx = Time to relax the other assumptions

Equality Constraints Consider the Wyndor Glass problem, where Plant 3 constraint is changed as follows: Maximize Z = 3x1+ 5x2 subject to x1  4 2x2  12 3x1+ 2x2 = 18 x1,x2 ≥ 0 Convert to augmented form: Any problems you foresee with the simplex method?

Artificial Variables and the Big M Introduce artificial variables to the problem Assign huge penalties in the objective function Maximize Z = 3x1+ 5x2 subject to x1  4 2x2  12 3x1+ 2x2 = 18 x1,x2 ≥ 0

Solving the new problem (1) Basic variable Z x1 x2 r.h.s. Basic variable Z x1 x2 r.h.s.

Solving the new problem (2) Basic variable Z x1 x2 r.h.s. Basic variable Z x1 x2 r.h.s.

Geometric Insight into Big M x2 (2,6) Original feasible region (4,3) x1

Geometric Insight into Big M (0,6) “Artificial” feasible region (0,0) (4,0)

Negative RHS Values Consider a constraint with bj < 0 Easy fix: e.g. The number of windows produced should be at most 5 less than the number of doors produced: Easy fix: Tough consequences

 Constraints Consider the Wyndor Glass problem, where Plant 3 constraint is changed as follows: Maximize Z = 3x1+ 5x2 subject to x1  4 2x2  12 3x1+ 2x2  18 x1,x2 ≥ 0 Convert to augmented form: Then use Big-M method

Variables Allowed to be Negative Maximize Z = 3x1+ 5x2 subject to x1  4 2x2  12 3x1+ 2x2  18 x1 ≥ -10, x2 ≥ 0 (When there is a bound on the negative values allowed)

Variables Allowed to be Negative Maximize Z = 3x1+ 5x2 subject to x1  4 2x2  12 3x1+ 2x2  18 x1 unrestricted in sign, x2 ≥ 0 (When there is no bound on the negative values allowed)

Traffic Signal Example Set green times for a crossroad Allocate a given cycle time of 62 seconds to E-W and N-S directions, less an all-red time of 2 seconds E-W direction should receive at least 10 seconds of green time at least 5 seconds less than twice the N-S green time A linear estimate for the average delay per car per lane is given as 120 - 2 (E-W GT) - 3 (N-S GT) Find the green time allocation to minimize average delay