(1d) Linear Programming - Simplex Method
(1d) Linear Programming - Simplex Method
PROGRAMMING:
Simplex Method
Reference:
Example:
-X1 + X2 ≤ -3
X1 - X2 ≥ 3
X1 - X2 – S1 = 3
Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 -5 -4 0 0 0 0 0
S1 0 6 4 1 0 0 0 24
S2 0 1 2 0 1 0 0 6
S3 0 -1 1 0 0 1 0 1
S4 0 0 1 0 0 0 1 2
Optimality Condition
◼ The entering variable defines the optimality condition of the
simplex tableau. Hence, it is the column of the most negative
(maximization problem) and most positive (minimization problem)
of the non basic variables (x1, x2, … , xn; excluding z)
Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 -5 -4 0 0 0 0 0
S1 0 6 4 1 0 0 0 24
S2 0 1 2 0 1 0 0 6
S3 0 -1 1 0 0 1 0 1
S4 0 0 1 0 0 0 1 2
Feasibility Condition
◼ The leaving variable defines the feasibility condition of the simplex
tableau. Hence, it is the row of the smallest non-negative ratio of
the basic variables (s1, s2, … , sn; excluding z)
𝑹𝑯𝑺
𝑹𝒂𝒕𝒊𝒐 =
𝑬𝒏𝒕𝒆𝒓𝒊𝒏𝒈 𝑽𝒂𝒓𝒊𝒂𝒃𝒍𝒆
Leaving Variable/s
Simplex Method
◼ Iteration 0 (Initial Tableau)
Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 -5 -4 0 0 0 0 0
S1 0 6 4 1 0 0 0 24
S2 0 1 2 0 1 0 0 6
S3 0 -1 1 0 0 1 0 1
S4 0 0 1 0 0 0 1 2
Simplex Method
◼ Divide the entire S1 row by the coefficient of X1.
Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 -5 -4 0 0 0 0 0
S1 0 6 4 1 0 0 0 24
S2 0 1 2 0 1 0 0 6
S3 0 -1 1 0 0 1 0 1
S4 0 0 1 0 0 0 1 2
Basic Z X1 X2 S1 S2 S3 S4 RHS
X1 0 1 2/3 1/6 0 0 0 4
Simplex Method
◼ Perform Gauss-Jordan operations to eliminate X1 from all other
rows.
Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 -5 -4 0 0 0 0 0
X1 0 1 2/3 1/6 0 0 0 4
S2 0 1 2 0 1 0 0 6
S3 0 -1 1 0 0 1 0 1
S4 0 0 1 0 0 0 1 2
Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 0 -2/3 5/6 0 0 0 20
X1 0 1 2/3 1/6 0 0 0 4
S2 0 0 4/3 -1/6 1 0 0 2
S3 0 0 5/3 1/6 0 1 0 5
S4 0 0 1 0 0 0 1 2
Simplex Method
◼ Final Iteration 1
Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 0 -2/3 5/6 0 0 0 20
X1 0 1 2/3 1/6 0 0 0 4
S2 0 0 4/3 -1/6 1 0 0 2
S3 0 0 5/3 1/6 0 1 0 5
S4 0 0 1 0 0 0 1 2
Simplex Method
◼ Iteration 2
New Entering Variable/s
Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 0 -2/3 5/6 0 0 0 20
X1 0 1 2/3 1/6 0 0 0 4
S2 0 0 4/3 -1/6 1 0 0 2
S3 0 0 5/3 1/6 0 1 0 5
S4 0 0 1 0 0 0 1 2
Simplex Method
◼ Iteration 2
New Entering Variable/s
Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 0 0 3/4 1/2 0 0 21
X1 0 1 0 1/4 -1/2 0 0 3
X2 0 0 1 -1/8 3/4 0 0 3/2
S3 0 0 0 3/8 -5/4 1 0 5/2
S4 0 0 0 1/8 -3/4 0 1 1/2
No entering variable.
Solution is considered optimal.
Simplex Method
◼ The optimal solution is given by:
𝑿𝟏 = 𝟑
𝟑
𝑿𝟐 =
𝟐
𝑺𝟏 = 𝟎
𝑺𝟐 = 𝟎
𝟓
𝑺𝟑 =
𝟐
𝟏
𝑺𝟒 =
𝟐
𝑴𝒂𝒙𝒊𝒎𝒖𝒎 𝒁 = 𝟐𝟏
Basic Concepts
◼ If the value of a variable is positive in the basic solution, then that
variable is a basic variable. Otherwise, it is a non-basic variable.
Basic Z X1 X2 X3 X4 S1 S2 S3 RHS
Z 1 -2 -1 3 -5 0 0 0 0
S1 0 1 2 -2 4 1 0 0 40
S2 0 2 -1 1 2 0 1 0 8
S3 0 4 -2 1 -1 0 0 1 10
Exercise
◼ Iteration 1
Basic Z X1 X2 X3 X4 S1 S2 S3 RHS
Z 1 3 -7/12 11/2 0 0 5/2 0 20
S1 0 -3 4 -4 0 1 -2 0 24
X4 0 1 -1/2 1/2 1 0 1/2 0 4
S3 0 5 -5/12 3/2 0 0 1/2 1 14
◼ Iteration 2
Basic Z X1 X2 X3 X4 S1 S2 S3 RHS
Z 1 3/8 0 2 0 7/8 3/4 0 41
X2 0 -3/4 1 -1 0 1/4 -1/2 0 6
X4 0 5/8 0 0 1 1/8 1/4 0 7
S3 0 25/8 0 -1 0 5/8 -3/4 1 29
Exercise
◼ Final Optimal Iteration (Iteration 2)
Basic Z X1 X2 X3 X4 S1 S2 S3 RHS
Z 1 3/8 0 2 0 7/8 3/4 0 41
X2 0 -3/4 1 -1 0 1/4 -1/2 0 6
X4 0 5/8 0 0 1 1/8 1/4 0 7
S3 0 25/8 0 -1 0 5/8 -3/4 1 29
◼ Optimal Answers:
X1 = 0 S1 = 0
X2 = 6 S2 = 0
X3 = 0 S3 = 29
X4 = 7 S4 = 0
Z = 41