Simplex Method September 2, 2009
Outline: Lecture 5 Re-cap blind search Simplex method in steps Simplex tableau Operations Research Methods 1
Determining an optimal solution by exhaustive search Lecture 5 From the LP theory (if interested take course IE 411), the optimal value of an LP problem is always attained at a corner point Thus, we can find the optimal value and an optimal solution by Generating a list of all basic solutions Crossing out infeasible solutions Computing the objective value for each feasible solution Choosing the basic feasible solutions with the best value (min or max) Operations Research Methods 2
Example: Reddy Mikks case Basic Variables Basic Solution Feasibility Status Objective Value x 1, x 2 3, 1.5 Feasible 21 x 1, x 3 6, 12 Infeasible XXX x 1, x 4 4, 0 Feasible 20 x 2, x 3 3, 12 Feasible 15 x 2, x 4 6, 6 Infeasible XXX x 3, x 4 24, 6 Feasible 0 Thus, the optimal solution is x 1 = 3, x 2 = 1.5, x 3 = 0, and x 4 = 0 and the optimal value is z = 21. In this case, we have only one solution Operations Research Methods 3
Search Bottleneck: Large number of the basic solutions Blind search can be time consuming (inefficient) Given an LP in the standard form with m equations and n variables, there are n(n 1)(n 2) (n m + 1) m! many basic solutions Say m = 4 and n = 8, then there are 70 solutions It is hard to manually list them all and find the best We will use a more efficient method (simplex method) to perform a smarter search (selectively moving to a better point) Operations Research Methods 4
Simplex method: started at a feasible basic solution Lecture 5 Illustrated on the Reddy Mikks problem Original LP formulation Standard LP form maximize z = 5x 1 + 4x 2 subject to 6x 1 + 4x 2 24 x 1 + 2x 2 6 x 1, x 2 0 maximize z = 5x 1 + 4x 2 subject to 6x 1 + 4x 2 + x 3 = 24 x 1 + 2x 2 + x 4 = 6 x 1, x 2, x 3, x 4 0 NOTE The basic variables are also referred to as a basis. Every basis has exactly m variables. Operations Research Methods 5
Initial iteration: (1) Choose an initial basic feasible solution (2) Check if it is optimal (if yes, we are done) Lecture 5 Suppose we choose x 3 and x 4 as basis We solve the equations in terms of x 1 and x 2 to find the basic feasible solution corresponding to this basis Basis Equations RHS Values (x 3 ) 6x 1 + 4x 2 + x 3 = 24 (x 4 ) x 1 + 2x 2 + x 4 = 6 When x 1 = x 2 = 0, we have the basic feasible solution readily available Item 2: Is this optimal? x 1 = 0 x 2 = 0 x 3 = 24 x 4 = 6 Operations Research Methods 6
Check Optimality We now check the optimality of the current basic solution (0,0,24,6) Express the cost in terms of nonbasic variables z = 5x 1 + 4x 2 In the basic solution (0, 0, 24, 6) the nonbasic variables are zero. Would increasing any of these values increase the objective value (max)? Operations Research Methods 7
Yes, actually increasing either x 1 or x 2 would improve the cost. Q: Why are we allowed to increase x 1 or x 2? So we can choose any of these variables, say we select x 1. Checking optimality in another form: Basis Equations RHS Values (z) row z 5x 1 4x 2 = 0 (x 3 ) 6x 1 + 4x 2 + x 3 = 24 (x 4 ) x 1 + 2x 2 + x 4 = 6 There are negative coefficients in z-row (associated with x 1 and x 2 ) The variables with negative coefficients indicate directions of improvement for the objective value (when maximizing) Operations Research Methods 8
Current basic solution (0,0,24,6) is not optimal: x 1 or x 2 can be increased to improve the z-value Next step: move to a better basic feasible solution by taking either x 1 or x 2 in the basis Suppose we choose x 1 Operations Research Methods 9
Next iteration: (1) Perform basis change (2) Determine its corresponding solution (3) Check its optimality (if yes, we are done) We have x 3 and x 4 as current basis and the nonoptimal solution (0, 0, 24, 6) We selected variable x 1 to enter the basis, but one of the current basic variables, x 3 or x 4, has to leave the basis x 1 entering the basis means that x 1 value is increasing from its current value 0 Is there anything prohibiting us to increase x 1 as much as we want? The answer is the constraint equations Operations Research Methods 10
Basis Equations RHS Values (z) row z 5x 1 4x 2 = 0 (x 3 ) 6x 1 + 4x 2 + x 3 = 24 (x 4 ) x 1 + 2x 2 + x 4 = 6 6x 1 + 4x 2 + x 3 = 24 = x 1 can be at most 24/6 = 4 x 1 + 2x 2 + x 4 = 6 = x 1 can be at most 6/1 =6 The variable corresponding to the smaller ratio leaves the basis. Thus, x 3 leaves the basis. The new basis is x 1 and x 4. We have completed item 1 task. Operations Research Methods 11
Item 2: determine the basic feasible solution corresponding to this basis. Lecture 5 In other words, we need to resolve the relations to express the new basic variables x 1 and x 4 in terms of nonbasic variables x 2 and x 3. Old basis Basis Equations RHS Values (z) row z 5x 1 4x 2 = 0 (x 1 ) x 3 left 6x 1 + 4x 2 + x 3 = 24 (x 4 ) x 1 + 2x 2 + x 4 = 6 Use Gauss-Jordan elimination Operations Research Methods 12
Gauss-Jordan: Divide the equation by 6 to have coeff. of x 1 equal to 1 Basis Equations RHS Values (z) row z 5x 1 4x 2 = 0 (x 1 ) x 1 + 2 3 x 2 + 1 6 x 3 = 4 (x 4 ) x 1 + 2x 2 + x 4 = 6 Gauss-Jordan: Eliminate x 1 from the second equation Basis Equations RHS Values (z) row z 5x 1 4x 2 = 0 (x 1 ) x 1 + 2 3 x 2 + 1 6 x 3 = 4 (x 4 ) The new basic feasible solution is (4,0,0,6) 4 3 x 2 1 6 x 3 + x 4 = 2 Lecture 5 Operations Research Methods 13
Item 3: Is this optimal? Gauss-Jordan: Eliminate x 1 from the z-row in the last table Basis Equations RHS Values (z) row z 2 3 x 2 + 5 6 x 3 = 20 (x 1 ) x 1 + 2 3 x 2 + 1 6 x 3 = 4 (x 4 ) 4 3 x 2 1 6 x 3 + x 4 = 2 The current basic solution is not optimal! Why? Thus, we have to perform another iteration. Which of the currently nonbasic variables, x 2 or x 4, when increased will result in increased z-value? Operations Research Methods 14
New iteration: (1) Perform basis change (2) Determine its corresponding solution (3) Check its optimality (if yes, we are done) We have x 1 and x 4 as current basis Lecture 5 We select variable x 2 to enter the basis, but one of the current basic variables, x 1 or x 4, has to leave the basis Which variable will leave the current basis? Perform ratio test Basis Equations RHS Values (z) row z 2 3 x 2 + 5 6 x 3 = 20 (x 1 ) x 1 + 2 3 x 2 + 1 6 x 3 = 4 (x 4 ) 4 3 x 2 1 6 x 3 + x 4 = 2 Operations Research Methods 15
x 1 + 2 3 x 2 + 1 6 x 3 = 4 = x 2 can be at most 4 2 3 = 6 4 3 x 2 1 6 x 3 + x 4 = 2 = x 2 can be at most 2 4 3 = 6 4 The variable corresponding to the smaller ratio leaves the basis. Thus, x 4 leaves the basis. The new basis is x 1 and x 2. Operations Research Methods 16
Item 2: Find the basic solution corresponding to the basis x 1 and x 2 Gauss-Jordan again Old table Basis Equations RHS Values (z) row z 2 3 x 2 + 5 6 x 3 = 20 (x 1 ) x 1 + 2 3 x 2 + 1 6 x 3 = 4 (x 2 ) x 4 left 4 3 x 2 1 6 x 3 + x 4 = 2 The number 4 3 is used to eliminate x 2 from x 2 -row and z-row This number is referred as pivot element Operations Research Methods 17
Gauss-Jordan elimination yields Basis Equations RHS Values (z) row z + 11 12 x 3 + 1 2 x 4 = 21 (x 1 ) x 1 + 1 4 x 3 1 2 x 4 = 3 (x 2 ) x 2 1 8 x 3 + 3 4 x 4 = 3 2 What is the current basic solution (corresponding to the data above). Item 3: Is this optimal? - Look at the coefficients of x 3 and x 4 in z-row. They are nonnegative - so the current basic solution is optimal What is the optimal objective value? Operations Research Methods 18
Simplex Path in Reddy Mikks Example (0, 0) (4, 0) (3, 1.5) Operations Research Methods 19