Prelude to the Simplex Algorithm The Algebraic Approach The search for extreme point solutions. 1
Linear Programming-1 x 2 12 8 (4,8) Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2 <= 12 x 1-2x 2 <= 6 x 2 <= 8 (10,2) 6 12 x 1-3 2
Linear Programming-2 x 2 12 8 z (4,8) Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2 <= 12 x 1-2x 2 <= 6 x 2 <= 8 z (10,2) 6 12 x 1-3 3
LP Terminology Feasible solution - solution in which all the constraints are satisfied. Optimal solution - feasible solution having the most favorable objective function value Boundary equation - the resulting equation after dropping the < or > on a constraint Corner point solution - a feasible solution that does not lie on any line segment connecting two other feasible solutions (extreme point). The intersection of two or more boundary equations. 4
Properties of Corner Point Solutions If there is exactly one optimal solution, then it must be a corner point solution. If there are multiple solutions then at least two must be adjacent corner point solutions. There are only a finite (although often large) number of corner point solutions. If a corner point solution is better than all of its adjacent corner point solutions, then it is better than all other feasible corner points. That is - it is optimal! 5
Convert Inequalities to Equations Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2 <= 12 x 1-2x 2 <= 6 x 2 <= 8 x 1 >= 0; x 2 >= 0 6
Convert Inequalities to Equations Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2 + x 3 = 12 x 1-2x 2 + x 4 = 6 x 2 + x 5 = 8 x 1 >= 0; x 2 >= 0 x 3 >= 0, x 4 >=0, x 5 >= 0 7
Convert Inequalities to Equations Max z = 6x 1 + 4x 2 Subj. to: slack variables x 1 + x 2 + x 3 = 12 x 1-2x 2 + x 4 = 6 x 2 + x 5 = 8 x 1 >= 0; x 2 >= 0 x 3 >= 0, x 4 >=0, x 5 >= 0 must be non-negative 8
Solutions Augmented solution - solution to the problem after slack variables have been added. solution - augmented corner point solution obtained by setting n variables to zero and solving for the remaining. feasible solution (BFS) - feasible basic solution. variables - variables that were solved for in the basic solution. Non-basic variables - variables set equal to zero in the basic solution. 9
Solutions-1 Non- Var z Corner Pt Comments x 1, x 2 x 3 =12, x 4 =6, x 5 =8 0 (0,0) origin Start at the origin! x 1 = x 2 = 0 Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2 + x 3 = 12 x 1-2x 2 + x 4 = 6 x 2 + x 5 = 8 + x 3 = 12 + x 4 = 6 + x 5 = 8 10
Graph-1 x 2 12 8 (4,8) Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2 <= 12 x 1-2x 2 <= 6 x 2 <= 8 x 1 = x 2 = 0 (10,2) 6 12 x 1-3 11
Solutions-2 Non- Var z Corner Pt Comments x 1, x 2 x 3 =12, x 4 =6, x 5 =8 0 (0,0) origin x 2, x 3 x 1 =12, x 4 = -6, x 5 = 8 - (12,0) infeasible Max z = 6x 1 + 4x 2 Go to another corner point! x 2 = x 3 = 0 Subj. to: x 1 + x 2 + x 3 = 12 x 1-2x 2 + x 4 = 6 x 2 + x 5 = 8 x 1 = 12 x 1 +x 4 = 6 x 5 = 8 12
Graph-2 x 2 12 8 (4,8) Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2 <= 12 x 1-2x 2 <= 6 x 2 <= 8 (10,2) x 1 = 12 x 2 = 0-3 6 infeasible 12 x 1 13
Solutions-3 Non- Var z Corner Pt Comments x 1, x 2 x 3 =12, x 4 =6, x 5 =8 0 (0,0) origin x 2, x 3 x 1 =12, x 4 =-6, x 5 = 8 - (12,0) infeasible x 2, x 4 x 1 =6, x 3 =6, x 5 =8 36 (6,0) Go to another adjacent corner point! x 2 = x 4 = 0 Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2 + x 3 = 12 x 1-2x 2 + x 4 = 6 x 2 + x 5 = 8 x 1 + x 3 = 12 x 1 = 6 x 5 = 8 14
Graph-3 x 2 12 8 (4,8) Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2 <= 12 x 1-2x 2 <= 6 x 2 <= 8 x 1 = 6 x 2 = 0 z = 36 (10,2) 6 12 x 1-3 15
Solutions-4 Non- Var z Corner Pt Comments x 1, x 2 x 3 =12, x 4 =6, x 5 =8 0 (0,0) origin x 2, x 3 x 1 =12, x 4 =-6, x 5 = 8 - (12,0) infeasible x 2, x 4 x 1 =6, x 3 =6, x 5 =8 36 (6,0) x 2, x 5 x 1, x 3, x 4 - infeasible Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2 + x 3 = 12 x 1-2x 2 + x 4 = 6 x 2 + x 5 = 8 x 1 + x 3 = 12 x 1 + x 4 = 6 0 = 8 16
Graph-4 x 2 12 8 (4,8) Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2 <= 12 x 1-2x 2 <= 6 x 2 <= 8 (10,2) 6 12 x 1-3 17
Solutions-5 Non- Var z Corner Pt Comments x 1, x 2 x 3 =12, x 4 =6, x 5 =8 0 (0,0) origin x 2, x 3 x 1 =12, x 4 =-6, x 5 = 8 - (12,0) infeasible x 2, x 4 x 1 =6, x 3 =6, x 5 =8 36 (6,0) x 2, x 5 x 1, x 3, x 4 - infeasible x 1, x 3 x 2 =12, x 4 =30, x 5 =-4 - (0,12) infeasible Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2 + x 3 = 12 x 1-2x 2 + x 4 = 6 x 2 + x 5 = 8 x 2 = 12-2x 2 + x 4 = 6 x 2 + x 5 = 8 18
8 (4,8) Graph-5 x 2 12 x 1 = 0 x 2 = 12 infeasible Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2 <= 12 x 1-2x 2 <= 6 x 2 <= 8 (10,2) 6 12 x 1-3 19
Solutions-6 Non- Var z Corner Pt Comments x 1, x 2 x 3 =12, x 4 =6, x 5 =8 0 (0,0) origin x 2, x 3 x 1 =12, x 4 =-6, x 5 = 8 - (12,0) infeasible x 2, x 4 x 1 =6, x 3 =6, x 5 =8 36 (6,0) x 2, x 5 x 1, x 3, x 4 - infeasible x 1, x 3 x 2 =12, x 4 =30, x 5 =-4 - (0,12) infeasible x 1, x 4 x 2 =-3, x 3 =15, x 5 =11 - (0,-3) infeasible Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2 + x 3 = 12 x 1-2x 2 + x 4 = 6 x 2 + x 5 = 8 x 2 + x 3 = 12-2x 2 = 6 x 2 + x 5 = 8 20
Graph-6 infeasible x 2 12 8 (4,8) Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2 <= 12 x 1-2x 2 <= 6 x 2 <= 8 x 1 = 0 x 2 = -3 (10,2) 6 12 x 1-3 21
Solutions-7 Non- Var z Corner Pt Comments x 1, x 2 x 3 =12, x 4 =6, x 5 =8 0 (0,0) origin x 2, x 3 x 1 =12, x 4 =-6, x 5 = 8 - (12,0) infeasible x 2, x 4 x 1 =6, x 3 =6, x 5 =8 36 (6,0) x 2, x 5 x 1, x 3, x 4 - infeasible x 1, x 3 x 2 =12, x 4 =30, x 5 =-4 - (0,12) infeasible x 1, x 4 x 2 =-3, x 3 =15, x 5 =11 - (0,-3) infeasible x 1, x 5 x 2 =8, x 3 =4, x 4 = 22 32 (0,8) x 2 + x 3 = 12-2x 2 +x 4 = 6 x 2 = 8 22
Graph-7 x 2 12 8 (4,8) Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2 <= 12 x 1-2x 2 <= 6 x 2 <= 8 x 1 = 0 x 2 = 8 z = 32 (10,2) 6 12 x 1-3 23
Solutions-8 Non- Var z Corner Pt Comments x 1, x 2 x 3 =12, x 4 =6, x 5 =8 0 (0,0) origin x 2, x 3 x 1 =12, x 4 =-6, x 5 = 8 - (12,0) infeasible x 2, x 4 x 1 =6, x 3 =6, x 5 =8 36 (6,0) x 2, x 5 x 1, x 3, x 4 - infeasible x 1, x 3 x 2 =12, x 4 =30, x 5 =-4 - (0,12) infeasible x 1, x 4 x 2 =-3, x 3 =15, x 5 =11 - (0,-3) infeasible x 1, x 5 x 2 =8, x 3 =4, x 4 = 22 32 (0,8) x 3, x 4 x 1 =10, x 2 =2, x 5 =6 68 (10,2) optimal x 1 + x 2 = 12 x 1-2x 2 = 6 x 2 + x 5 = 8 24
Graph-8 x 2 12 8 (4,8) Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2 <= 12 x 1-2x 2 <= 6 x 2 <= 8 x 1 = 10 x 2 = 2 z = 68 (10,2) 6 12 x 1-3 25
Solutions-9 and 10 Non- Var z Corner Pt Comments x 1, x 2 x 3 =12, x 4 =6, x 5 =8 0 (0,0) origin x 2, x 3 x 1 =12, x 4 =-6, x 5 = 8 - (12,0) infeasible x 2, x 4 x 1 =6, x 3 =6, x 5 =8 36 (6,0) x 2, x 5 x 1, x 3, x 4 - infeasible x 1, x 3 x 2 =12, x 4 =30, x 5 =-4 - (0,12) infeasible x 1, x 4 x 2 =-3, x 3 =15, x 5 =11 - (0,-3) infeasible x 1, x 5 x 2 =8, x 3 =4, x 4 = 22 32 (0,8) x 3, x 4 x 1 =10, x 2 =2, x 5 =6 68 (10,2) optimal x 3, x 5 x 1 =4, x 2 =8, x 4 =18 56 (4,8) x 4, x 5 x 1 =22, x 2 =8, x 3 =-18 - (22,8) infeasible 26
x 2 12 Graph-9 and 10 Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2 <= 12 x 1-2x 2 <= 6 x 2 <= 8 8 (4,8) x 1 =22 x 2 =8 (10,2) 6 12 x 1-3 27
Well, just how many basic solutions are there?!!! 28
Solutions Let n = the number of variables m = the number of constraints After adding slack variables, there are n + m variables. Since a basic solution requires setting n variables to zero and solving uniquely for the remaining variables, there are F HG n+ m n I KJ = ( n+ m)! nm!! ways to select the n variables to set equal to zero or equivalently the m basic variables. If n = 20 and m = 10 (a trivially small problem), then 30!/(20! 10!) = 30,045,015. (not all are feasible) 29
Solutions Again! Augmented solution - solution to the problem after slack variables have been added. solution - augmented corner point solution obtained by setting n variables to zero and solving for the remaining. feasible solution (BFS) - feasible basic solution. variables - variables that were solved for in the basic solution. Non-basic variables - variables set equal to zero in the basic solution. 30
Outline of the Simplex Algorithm Start at a basic feasible solution (BFS) (often the origin) Move to a better basic feasible solution the objective function improves Stop when the basic feasible solution is better than all adjacent basic feasible solutions. Solution is optimal I can do this! 31
Now - Presenting the Simplex Algorithm! Be the first in your neighborhood to master this exciting and wonderful numerical, recursive process for solving linear programs. Two students discussing the high points of the simplex algorithm. 32
The Simplex Tableau-1 Max z - 6x 1-4x 2 = 0 Subj. to: x 1 + x 2 + x 3 = 12 x 1-2x 2 + x 4 = 6 x 2 + x 5 = 8 33
The Simplex Tableau-2 Max z - 6x 1-4x 2 = 0 Subj. to: x 1 + x 2 + x 3 = 12 x 1-2x 2 + x 4 = 6 x 2 + x 5 = 8 0 z 1-6 -4 0 0 0 0 34
The Simplex Tableau-3 Max z - 6x 1-4x 2 = 0 Subj. to: x 1 + x 2 + x 3 = 12 x 1-2x 2 + x 4 = 6 x 2 + x 5 = 8 0 z 1-6 -4 0 0 0 0 1 x 3 0 1 1 1 0 0 12 35
The Simplex Tableau-4 Max z - 6x 1-4x 2 = 0 Subj. to: x 1 + x 2 + x 3 = 12 x 1-2x 2 + x 4 = 6 x 2 + x 5 = 8 0 z 1-6 -4 0 0 0 0 1 x 3 0 1 1 1 0 0 12 2 x 4 0 1-2 0 1 0 6 36
The Simplex Tableau-5 Max z - 6x 1-4x 2 = 0 Subj. to: x 1 + x 2 + x 3 = 12 x 1-2x 2 + x 4 = 6 x 2 + x 5 = 8 0 z 1-6 -4 0 0 0 0 1 x 3 0 1 1 1 0 0 12 2 x 4 0 1-2 0 1 0 6 3 x 5 0 0 1 0 0 1 8 37
The Simplex Algorithm-1 Step 1: Select a new variable to enter the basis. 0 z 1-6 -4 0 0 0 0 1 x 3 0 1 1 1 0 0 12 2 x 4 0 1-2 0 1 0 6 3 x 5 0 0 1 0 0 1 8 38
The Simplex Algorithm-2 z = 6x 1 + 4x 2 Step 1: Select a new variable to enter the basis. Pick the non-basic variable having the greatest negative value. 0 z 1-6 -4 0 0 0 0 1 x 3 0 1 1 1 0 0 12 2 x 4 0 1-2 0 1 0 6 3 x 5 0 0 1 0 0 1 8 39
Step 2a: Select a basic variable to leave the basis. 0 z 1-6 -4 0 0 0 0 1 x 3 0 1 1 1 0 0 12 2 x 4 0 1-2 0 1 0 6 3 x 5 0 0 1 0 0 1 8 40
Step 2b: Select a basic variable to leave the basis. Pick the basic variable having the smallest ratio of the RHS divided by the corresponding positive coefficient from the incoming variable. Ratio 0 z 1-6 -4 0 0 0 0 1 x 3 0 1 1 1 0 0 12 2 x 4 0 1-2 0 1 0 6 12/1 6/1 3 x 5 0 0 1 0 0 1 8 41
Step 2c: Select a basic variable to leave the basis. Pick the basic variable having the smallest ratio of the RHS divided by the corresponding positive coefficient from the incoming variable. 1x 1-2x 2 + x 4 = 6 Ratio 0 z 1-6 -4 0 0 0 0 1 x 3 0 1 1 1 0 0 12 2 x 4 0 1-2 0 1 0 6 12/1 6/1 3 x 5 0 0 1 0 0 1 8 pivot point 42
Step 3a: Use row operations to find the new basic solution. 0 z 1-6 -4 0 0 0 0 1 x 3 0 1 1 1 0 0 12 2 x 4 0 1-2 0 1 0 6 3 x 5 0 0 1 0 0 1 8 0 z 1 x 3 2 x 1 3 x 5 43
Step 3b: Use row operations to find the new basic solution. 0 z 1-6 -4 0 0 0 0 1 x 3 0 1 1 1 0 0 12 2 x 4 0 1-2 0 1 0 6 3 x 5 0 0 1 0 0 1 8 0 z 1 x 3 2 x 1 0 1-2 0 1 0 6 3 x 5 44
Step 3c: Use row operations to find the new basic solution. 0 z 1-6 -4 0 0 0 0 1 x 3 0 1 1 1 0 0 12 2 x 4 0 1-2 0 1 0 6 3 x 5 0 0 1 0 0 1 8 0 z 1 x 3 2 x 1 3 x 5 0 1-2 0 1 0 6 0 0 1 0 0 1 8 45
Step 3d: Use row operations to find the new basic solution. 0 z 1-6 -4 0 0 0 0 1 x 3 0 1 1 1 0 0 12 2 x 4 0 1-2 0 1 0 6 3 x 5 0 0 1 0 0 1 8 0 z 1 x 3 0 0 3 1-1 0 6 2 x 1 3 x 5 0 1-2 0 1 0 6 0 0 1 0 0 1 8 46
Step 3e: Use row operations to find the new basic solution. 0 z 1-6 -4 0 0 0 0 1 x 3 0 1 1 1 0 0 12 2 x 4 0 1-2 0 1 0 6 3 x 5 0 0 1 0 0 1 8 0 z 1 x 3 1 0-16 0 6 0 36 0 0 3 1-1 0 6 2 x 1 3 x 5 0 1-2 0 1 0 6 0 0 1 0 0 1 8 47
x 2 12 Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2 <= 12 x 1-2x 2 <= 6 x 2 <= 8 8 z (4,8) z (10,2) 6 12 x 1-3 48
2nd Iteration-1 z = 6x 1 + 4x 2 Now Sally, you want to pick the new variable to enter the basis. 0 z 1 0-16 0 6 0 36 1 x 3 0 0 3 1-1 0 6 2 x 1 0 1-2 0 1 0 6 3 x 5 0 0 1 0 0 1 8 49
2nd Iteration-2 z = 6x 1 + 4x 2 Pick the non-basic variable having the greatest negative value. 0 z 1 0-16 0 6 0 36 1 x 3 0 0 3 1-1 0 6 2 x 1 0 1-2 0 1 0 6 3 x 5 0 0 1 0 0 1 8 50
2nd Iteration-3 z = 6x 1 + 4x 2 Find minimum ratio Ratio 0 z 1 0-16 0 6 0 36 1 x 3 0 0 3 1-1 0 6 6/3 2 x 1 0 1-2 0 1 0 6 3 x 5 0 0 1 0 0 1 8 8/1 51
2nd Iteration-4 z = 6x 1 + 4x 2 Find minimum ratio Ratio 0 z 1 0-16 0 6 0 36 1 x 3 0 0 3 1-1 0 6 6/3 2 x 1 0 1-2 0 1 0 6 3 x 5 0 0 1 0 0 1 8 Pivot point 52 8/1
2nd Iteration-5 0 z 1 0-16 0 6 0 36 1 x 3 0 0 3 1-1 0 6 2 x 1 0 1-2 0 1 0 6 3 x 5 0 0 1 0 0 1 8 0 z 1 x 2 2 x 1 3 x 5 53
2nd Iteration-6 0 z 1 0-16 0 6 0 36 1 x 3 0 0 3 1-1 0 6 2 x 1 0 1-2 0 1 0 6 3 x 5 0 0 1 0 0 1 8 0 z 1 x 2 0 0 1 1/3-1/3 0 2 2 x 1 3 x 5 54
2nd Iteration-7 0 z 1 0-16 0 6 0 36 1 x 3 0 0 3 1-1 0 6 2 x 1 0 1-2 0 1 0 6 3 x 5 0 0 1 0 0 1 8 0 z 1 x 2 2 x 1 0 0 1 1/3-1/3 0 2 0 1 0 2/3 1/3 0 10 3 x 5 55
2nd Iteration-8 0 z 1 0-16 0 6 0 36 1 x 3 0 0 3 1-1 0 6 2 x 1 0 1-2 0 1 0 6 3 x 5 0 0 1 0 0 1 8 0 z 1 x 2 0 0 1 1/3-1/3 0 2 2 x 1 3 x 5 0 1 0 2/3 1/3 0 10 0 0 0-1/3 1/3 1 6 56
2nd Iteration-9 0 z 1 0-16 0 6 0 36 1 x 3 0 0 3 1-1 0 6 2 x 1 0 1-2 0 1 0 6 3 x 5 0 0 1 0 0 1 8 0 z 1 x 2 1 0 0 16/3 2/3 0 68 0 0 1 1/3-1/3 0 2 2 x 1 3 x 5 0 1 0 2/3 1/3 0 10 0 0 0-1/3 1/3 1 6 57
Clearly, this solution must be optimal. 2nd Iteration-10 What does it mean to be optimal? 0 z 1 x 2 1 0 0 16/3 2/3 0 68 0 0 1 1/3-1/3 0 2 2 x 1 3 x 5 0 0 0-1/3 1/3 1 6 0 1 0 2/3 1/3 0 10 58
x 2 12 Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2 <= 12 x 1-2x 2 <= 6 x 2 <= 8 8 z (4,8) z (10,2) 6 12 x 1-3 59
After the Simplex What can go wrong? Minimization rather than maximization Unbounded solutions Alternate solutions No feasible solution 60
What s Next? It just doesn t get any better than this! Wanna bet! Wait until you see sensitivity analysis. 61
I think I understand how to find the most negative value and the smallest ratio, but I get dizzy when I pivot. 62