Professional Documents
Culture Documents
C4 - Simplex Method
C4 - Simplex Method
2 3 7
and read off answer from right
column
4 5 13
2 3 7 1 3
2
7 2
row1new= 1/2 * row1
1 2
row2 ne
1 3 7
w
3 7
2 2 2
0 1 1 row2new= (-1) * row2
0 1 1
w2
/ 2) * ro
1 2
3
0 –( -
= row1
row1 ne
w
0 1 1 Read off solution: x1 = 2, x2 = 1
Introduction to Simplex Method
Developed by George Dantzig in 1947.
The simplex method:
moves from one extreme point to its neighboring extreme
point, stopping when the objective function can no longer be
improved.
The procedure ends when the optimal solution is found or the
problem has no solution.
Based on the Gauss-Jordan elimination procedure.
The simplex algorithm
Start
Convert to LP
standard form
Optimal
End
solution Yes
No
Example
Convert to:
x1 + x2 = 10
x1 + x 2 + A 1 =
2x1 + 2 x2 5
10
4x1 + 3 x2 8
2x1 + 2 x2 + s1 = 5
4x1 + 3 x2 - s2 + A 2 = 8
Where S1: Slack var.,
S2: Surplus var.
A1: Artificial var.
The simplex algorithm
The standard LP problem:
Basic solutions
The constraints consist of m equations and n variables (with
n> m). So the basic solution gives
m variables different from zero and
(n-m) variables must be zero.
We call:
m variables are basic solution and
(n-m) variables are non-basic variables.
The simplex algorithm
The standard LP problem
Convert to LP
standard form
Optimal
End
solution Yes
No
Convert to LP
standard form
Optimal
End
solution Yes
No
Basic X1 X2 S1 S2 S3 RHS
variable
Z -3 -5 0 0 0 0
S1 1 0 1 0 0 4
S2 0 2 0 1 0 12
S3 3 2 0 0 1 18
Is the current BFS
The initial solution:
Optimal?
x1 = x2 = 0 : nonbasic variables
s1 = 4; s2 = 12; s3 = 18 : basic variables Z=0
The simplex algorithm (Max problem)
Determine entering variable, leaving variable,
pivot number Entering variable (largest negative)
s1 (1) 1 0 1 0 0 4
0
s2 (2) 0 2 0 1 0 12
A1 (3) 3 2 0 0 1 18
Iteration Basic Eq. x1 x2 s1 s2 A1 RHS
varibles
Z (0) 0 -2M-5 3M+3 0 0 -6M+12
X1 (1) 1 0 1 0 0 4
1
s2 (2) 0 2 0 1 0 12
A1 (3) 0 2 -3 0 1 6
Big M method
Step 3: Applicating of the Simplex Method (cont)
Iteration Basic Eq. x1 x2 s1 s2 A1 RHS
varibles
Z (0) 0 0 -9/2 0 M+5/2 27
X1 (1) 1 0 1 0 0 4
2
s2 (2) 0 0 3 1 -1 6
X2 (3) 0 1 -3/2 0 1/2 3
Phase 2:
Continue with the min Z= 0.4x1 + 0.5x2
Phase 1: basic feasible st:
min Z’ = A1+A2 0.3x1 + 0.1x2 + s1 = 2.7
st:
solution of phase 0.5x1 + 0.5x2 = 6
0.3x1 + 0.1x2 + s1=2.7 1. 0.6x1 + 0.4x2 - s2 = 6
0.5x1 + 0.5x2 + A1= 6 x1,x2,s1,s2 ≥0
0.6x1+ 0.4x2 - s2+A2 = 6
x1,x2,s1,s2,A1,A2≥0
Phase 1
Iter Basic Vars. Z X1 X2 S1 A1 S2 A2 RHS
0 Z -1 -1.1 -0.9 0 0 1 0 -12
S1 0 0.3 0.1 1 0 0 0 2.7
A1 0 0.5 0.5 0 1 0 0 6
A2 0 0.6 0.4 0 0 -1 1 6
Iter Basic Vars. Z X1 X2 S1 A1 S2 A2 RHS
1 Z -1 0 -16/30 11/3 0 1 0 -2.1
X1 0 1 1/3 10/3 0 0 0 9
A1 0 0 1/3 -5/3 1 0 0 1.5
A2 0 0 0.2 -2 0 -1 1 0.6
Iter Basic Vars. Z X1 X2 S1 A1 S2 A2 RHS
2 Z -1 0 0 -5/3 0 -5/3 8/3 -0.5
X1 0 1 0 20/3 0 5/3 -5/3 8
A1 0 0 0 5/3 1 5/3 -5/3 0.5
X2 0 0 1 -10 0 -5 5 3
Iter Basic Vars. Z X1 X2 S1 A1 S2 A2 RHS
2 Z -1 0 0 0 1 0 1 0
X1 0 1 0 0 -4 -5 5 6
S1 0 0 0 1 3/5 1 -1 0.3
X2 0 0 1 0 6 5 -5 6
Phase 2 preparation
Basic Vars. Z X1 X2 S1 A1 S2 A2 RHS
Z -1 0 0 0 1 0 1 0
Final Phase 1 X1 0 1 0 0 -4 -5 5 6
S1 0 0 0 1 3/5 1 -1 0.3
X2 0 0 1 0 6 5 -5 6
Basic Vars. Z X1 X2 S1 A1 S2 A2 RHS
Z -1 0 0 0 0 0
Drop A1, A2 X1 0 1 0 0 -5 6
S1 0 0 0 1 1 0.3
X2 0 0 1 0 5 6
This graph shows the sequence of Coner Point Feasible solutions for
phase 1 (0, 1, 2, 3) and then for phase 2 ([0] ,[1])
Four Special cases in Simplex method
(watch video)
1. Degeneracy
2. Alternative optimal
3. Unbounded solution
4. Infeasible solution
Four Special cases in Simplex method
Degeneracy:
It is situation when the solution of the problem degenerates.
Degenerate Solution:
A Solution of the problem is said to be degenerate solution if
value or values of basic variable(s) become zero
It occurs due to redundant constraints.
Four Special cases in Simplex method
Degeneracy
This is in itself not a problem, but making simplex iterations
form a degenerate solution, give rise to cycling, meaning that
after a certain number of iterations without improvement in
objective value the method may turn back to the point where it
started.
Four Special cases in Simplex method
Degeneracy
Max Z = 3x1 + 9x2
Subject to:
x1 + 4x2 ≤ 8
X1 + 2x2 ≤ 4
X1, x2 ≥ 0
Four Special cases in Simplex method
The solution:
Step 1: Write inequalities in equation form
Let s and s be the slack variables
1 2
x1 + 4x2 + s1= 8
x1 + 2x2 + s2= 4
x1, x2 ,s1,s2≥ 0
Let x1=0, x2=0
Z=0, s1=8, s2=4
Four Special cases in Simplex method
Degeneracy
X2 will enter the basis because of having minimum objective function
Initial Tableau coefficient.
Entering Variable Leaving Variable
Basis X1 X2 S1 S2 RHS Ratio
Z -3 -9 0 0 0
S1 1 4 1 0 8 8/4=2
S2 1 2 0 1 4 4/2=2
S1 and S2 tie for leaving variable( with same minimum ratio 2) so we can
take any one of them arbitrary.
Four Special cases in Simplex method
Tableau 1 Degeneracy
Basis X1 X2 S1 S2 RHS Ratio
Z -3/4 0 9/4 0 18
X2 1/4 1 1/4 0 2 8
S2 ½ 0 -1/2 1 0 0 min
Basis X1 X2 S1 S2 RHS
Z 0 0 3/2 3/2 18
X2 0 1 1/2 -1/2 2
X1 1 0 -1 2 0
Same objective function no change and
improvement ( cycle)
Four Special cases in Simplex method
Degeneracy
This is redundant constraint because its presence
or absence does not affect, neither on optimal
point nor on feasible region.
Feasible
Region
Four Special cases in Simplex method
Alternative optimal:
Z-row value for one or more non basic variables is 0 in the
optimal tableau
When the objective function is parallel to a binding constraint,
objective function will assume same optimal value.
Four Special cases in Simplex method
Alternative optimal
Example:
Max Z= 2x1+ 4 x2
ST
x1 + 2x2 ≤ 5
x1 + x2 ≤ 4
x1, x2 ≥0
Four Special cases in Simplex method
Alternative optimal
The solution
Max Z=2x1+ 4x2
Let S1and S2 be the slack variables
x1 + 2x2 + s1= 5
x1 + x 2 + s2 = 4
x1, x2, s1, s2 ≥0
Initial solution
Let x1 = 0, x2 = 0,
Four Special cases in Simplex method
Alternative optimal
Initial Tableau Entering Variable
Leaving Variable
Four Special cases in Simplex method
Alternative optimal
Optimal solution is 10 when x2=5/2, x1=0.
Z 0 0 2 0 10
X2 1/2 1 1/2 0 5/2 5
S2 1/2 0 -1/2 1 3/2 3
The coefficient of x1 =0 that x1 can enter the basic solution without changing the
value of Z.
Optimal sol. Z=10 , x1=0, x2=5/2
Four Special cases in Simplex method
Alternative optimal
The second alternative optimal is:
Basis X1 X2 S1 S2 RHS
Z 0 0 2 0 10
X2 0 1 1 -1 1
X1 1 0 -1 2 3
The new optimal solution is 10 when x1=3, x2=1
Four Special cases in Simplex method
Alternative optimal
Objective Function
Four Special cases in Simplex method
Unbounded Solution
When determining the leaving variable of any tableau, if there
is no positive ratio (all the entries in the pivot column are
negative and undefined), then the solution is unbounded.
Four Special cases in Simplex method
Unbounded Solution
Example
Max Z= 2x1+ x2
Subject to
x1 – x2 ≤10
2x1 ≤ 40
x1, x2≥0
Four Special cases in Simplex method
Unbounded Solution
Max 2x1+ x2
Let S1 and S2 be the slack variables
x1 – x2 +s1 =10
2x1+0x2 + s2 =40
x1, x2,s1,s2 ≥0
Initial Solution: x1 = 0, x2=0,
Z=0, s1 =10, s2 =40
Four Special cases in Simplex method
Unbounded Solution
59
Four Special cases in Simplex method
Unbounded Solution
Basis X1 X2 S1 S2 RHS Ratio
Z 0 -3 2 0 20
X1 1 -1 1 0 10 -
S2 0 2 -2 1 20 10
60
Four Special cases in Simplex method
Unbounded
Basis X1 X2 S1 S2 RHS Ratio
Z 0 0 -3 3/2 50
X1 1 0 0 ½ 20 20/0-
X2 0 1 -1 1/2 10 10/-1
61
Four Special cases in Simplex method
Unbounded Solution
Objective function
Unbounded
0
Solution
≤1
Space
2
x
–
2x1 ≤ 40
1
x
Optimal Point
Four Special cases in Simplex method
Infeasible Solution:
No feasible optimal solution is available.
Constraints are conflicting.
An artificial variable still remains in the final tableau
Four Special cases in Simplex method
Infeasible Solution:
MAX Z= 2x1 + 6x2
s. t.
4x1 + 3x2 < 12
2x1 + x2 > 8
x1, x2 >= 0
Four Special cases in Simplex method
Infeasible Solution:
x1 x2 s1 s2 A1 RHS
Z -2-2M 6-M 0 M 0 -8M
S1 4 3 1 0 0 12
A1 2 1 0 -1 1 8
x1 x2 s1 s2 A1 RHS
Z 0 15/2+ 1/2M 1/2+1/2M M 0 6-2M
S1 1 3/4 1/4 0 0 3
A1 0 1/2 -1/2 -1 1 2
x2
2x1 + x2 > 8
2x1 + 6x2 =Z
x1