0% found this document useful (0 votes)
2 views

Chapter 4 - Solving Linear Programs Part 2

Uploaded by

zqweo23
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Chapter 4 - Solving Linear Programs Part 2

Uploaded by

zqweo23
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Chapter 4

Solving Linear Program:


Part 2: Simplex Method with Tableau Form
Prof. Hai Yang
Department of Civil and Environmental Engineering
HKUST

1
Structure of a Tableau Form

Tableau Basis 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 𝒔𝟑 Value Ratio


Coefficients of
𝑐𝑗
Objective Function

Iteration Basic Coefficients of Coefficients of Right-hand


Ratio
number Variables Obj. Function Constraints side (RHS)

𝑧𝑗 Z value
Checking Variables
𝑐𝑗 −𝑧𝑗

2
Solution by Simplex Tableau: Example 1

Max 𝒁 = 𝟓𝒙𝟏 + 𝟖𝒙𝟐


s.t.
𝒙𝟏 + 𝟐𝒙𝟐 ≤ 𝟏𝟐
𝟒𝒙𝟏 + 𝟓𝒙𝟐 ≤ 𝟒𝟎
𝒙𝟏 ≤𝟓
𝒙𝟏 , 𝒙𝟐 ≥ 𝟎

3
Simplex Method: Processes of Simplex Method

Stage 1

• Q1: Check feasible solution

Stage 2

• Q2: Check optimal solution

• Q3: Determine entering and leaving variables

• Q4: Develop new simplex pivot

4
Example 1 (Stage 2)
Check whether a Basic Solution is Optimal (Q2)

• Maximization Problem
– If the coefficients of all non-basic variables are
negative, this basic solution is optimal
– If the coefficient of any non-basic variables is
positive, this basic solution is not optimal
– If the coefficients of some non-basic variables are 0
and those of other non-basic variables are all
negative, this basic solution is optimal and this
problem has alternate optima

5
Example 1 (Stage 2)
Check whether a Basic Solution is Optimal (Q2)

• The non-basic variables are 𝑥1 , 𝑥2


• The coefficients of the non-basic variables are 5, 8; both of
them are positive
• This basic solution is not optimal
Tableau Basis 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 𝒔𝟑 Value Ratio 𝐵0 = {𝑠1 , 𝑠2 , 𝑠3 }
𝑐𝑗 5 8 0 0 0
𝒔1 0 1 2 1 0 0 12
𝑥1 + 2𝑥2 + 𝒔𝟏 = 12
𝒔2 0 4 5 0 1 0 40 4𝑥1 + 5𝑥2 + 𝒔𝟐 = 40
0 𝒔3 0 1 0 0 0 1 5 𝑥1 + 𝒔𝟑 = 5
𝑧𝑗 0 0 0 0 0 0
𝑍 = 0 + 5𝑥1 + 8𝑥2
𝑐𝑗 − 𝑧𝑗 5 8 0 0 0

If the coefficient of any non-basic variable (its value = 0 at the present


extreme point) is positive, that means objective function can still be
increased, since the non-basic variable can be put into basic variable set
(to have a value ≥ 0 as a new basic variable at the next extreme point). 6
Simplex Method: Processes of Simplex Method

Stage 1

• Q1: Check feasible solution

Stage 2

• Q2: Check optimal solution

• Q3: Determine entering and leaving variables

• Q4: Develop new simplex pivot

7
Example 1 (Stage 2)
Select an Entering Variable (Q3)

• Maximization problem
– Select the non-basic variable with a positive coefficient in the
objective function
• 𝑥1 is a non-basic variable with a positive coefficient
𝑥1 is the entering
variable

Tableau Basis 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 𝒔𝟑 Value Ratio


𝐵0 = {𝑠1 , 𝑠2 , 𝑠3 }
𝑐𝑗 5 8 0 0 0
𝒔1 0 1 2 1 0 0 12 𝑥1 + 2𝑥2 + 𝒔𝟏 = 12
𝒔2 0 4 5 0 1 0 40 4𝑥1 + 5𝑥2 + 𝒔𝟐 = 40
0 𝒔3 0 1 0 0 0 1 5 𝑥1 + 𝒔𝟑 = 5
𝑧𝑗 0 0 0 0 0 0
𝑐𝑗 − 𝑧𝑗 5 8 0 0 0
𝑍 = 0 + 5𝑥1 + 8𝑥2
𝑥1 is the entering
Pivot Column variable
8
Example 1 (Stage 2)
Decide the Leaving Variable (Q3)
• The leaving variable is the one that first goes to zero as the
value of entering variable increases from zero
– Set 𝑥1 to the maximum while maintaining all variables non-negative.
𝐵0 = {𝑠1 , 𝑠2 , 𝑠3 }
𝑥1 will replace 𝑠3
as the new basic 𝑥1 + 2𝑥2 + 𝒔𝟏 = 12, 𝑠1 ≥ 0 requires 𝑥1 ≤ 12
variable
4𝑥1 + 5𝑥2 + 𝒔𝟐 = 40, 𝑠2 ≥ 0 requires 𝑥1 ≤ 10
𝑥1 + 𝒔𝟑 = 5, 𝑠3 ≥ 0 requires 𝑥1 ≤ 5 more limiting,
hence 𝑠3 is the leaving variable
𝑍 = 0 + 5𝑥1 + 8𝑥2 Pivot Column
Tableau Basis 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 𝒔𝟑 Value Ratio
𝑐𝑗 5 8 0 0 0
𝒔1 0 1 2 1 0 0 12 12=12/1
𝑠3 is the leaving
variable 𝒔2 0 4 5 0 1 0 40 10=40/4
0 𝒔3 0 1 0 0 0 1 5 5=5/1 Pivot Row
𝑧𝑗 0 0 0 0 0 0
𝑐𝑗 − 𝑧𝑗 5 8 0 0 0
9
Pivot Element
Simplex Method: Processes of Simplex Method

Stage 1

• Q1: Check feasible solution

Stage 2

• Q2: Check optimal solution

• Q3: Determine entering and leaving variables

• Q4: Develop new simplex pivot

10
Example 1 (Stage 2)
Develop New Simplex Pivot (Q4)
• Using the equation of the leaving variable and the
entering variable to get a new basic feasible solution
– Change the coefficients of all basic variables to be 1.
𝑠𝑡
0 1
𝐵 = {𝑠1 , 𝑠2 , 𝑠3 } Change the 𝐵 = {𝑠1 , 𝑠2 , 𝑥1 }
𝑥1 + 2𝑥2 + 𝒔𝟏 = 12 basic variable 𝒙𝟏 + 2𝑥2 + 𝒔𝟏 = 12
4𝑥1 + 5𝑥2 + 𝒔𝟐 = 40 4𝒙𝟏 + 5𝑥2 + 𝒔𝟐 = 40
𝑥1 + 𝒔𝟑 = 5 𝒙𝟏 + 𝑠3 = 5 ⇒ 𝒙𝟏 = 5 − 𝑠3
𝑍 = 0 + 5𝑥1 + 8𝑥2 𝑍 = 0 + 5𝑥1 + 8𝑥2

𝑍 = 0 + 5 5 − 𝑠3 + 8𝑥2 Modify the constraints such that


1. The coefficients of all basic variables are 1
2. Each constraint contains only one basic variable
Modify the objective function
such that it does not contain 5 − 𝑠3 + 2𝑥2 + 𝒔𝟏 = 12
any basic variable.
4 5 − 𝑠3 + 5𝑥2 + 𝒔𝟐 = 40
𝒙𝟏 + 𝑠3 = 5
11
Example 1 (Stage 2)
Develop New Simplex Pivot (Q4)
• Change the basic variable
Tableau Basis 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 𝒔𝟑 Value Ratio
𝑐𝑗 5 8 0 0 0
𝒔1 0 1 2 1 0 0 12 12
𝒔2 0 4 5 0 1 0 40 10
} non-pivot
row

0 𝒔𝟑 0 1 0 0 0 1 5 5 pivot row
𝑧𝑗 0 0 0 0 0 0
𝑐𝑗 − 𝑧𝑗 5 8 0 0 0
𝒔1 0
𝒔2 0

1st 𝒙𝟏 5
𝑧𝑗
𝑐𝑗 − 𝑧𝑗
𝑠𝑡
1
𝐵0 = {𝑠1 , 𝑠2 , 𝑠3 } 𝐵 = {𝑠1 , 𝑠2 , 𝑥1 }
𝑥1 + 2𝑥2 + 𝒔𝟏 = 12 𝒙𝟏 + 2𝑥2 + 𝒔𝟏 = 12
4𝑥1 + 5𝑥2 + 𝒔𝟐 = 40 4𝒙𝟏 + 5𝑥2 + 𝒔𝟐 = 40
𝑥1 + 𝒔𝟑 = 5 𝒙𝟏 + 𝑠3 = 5
12
𝑍 = 0 + 5𝑥1 + 8𝑥2 𝑍 = 0 + 5𝑥1 + 8𝑥2
Example 1 (Stage 2)
Develop New Simplex Pivot (Q4)
Modify the constraints such that 1. Divide the pivot row by the pivot
1. The coefficients of all basic variables are 1 element to get a new pivot row
[1 0 0 0 1 5 ] ← [ 1 0 0 0 1 5 ] / 1
2. Each constraint contains only one basic variable

Tableau Basis 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 𝒔𝟑 Value Ratio


𝑐𝑗 5 8 0 0 0
𝑠1 0 1 2 1 0 0 12 12
Change it to 𝑠2 0 4 5 0 1 0 40 10
} non-pivot
row
be 1, without 0 𝒔𝟑 0 1 0 0 0 1 5 5 pivot row
changing the 𝑧𝑗 0 0 0 0 0 0
constraint 𝑐𝑗 − 𝑧𝑗 5 8 0 0 0
𝑠1 0
𝑠2 0
st
1 𝒙𝟏 5 1 0 0 0 1 5
𝑧𝑗
𝑐𝑗 − 𝑧𝑗
𝑠𝑡 𝑠𝑡
1 1
𝐵 = {𝑠1 , 𝑠2 , 𝑥1 } 𝐵 = {𝑠1 , 𝑠2 , 𝑥1 }
𝒙𝟏 + 2𝑥2 + 𝒔𝟏 = 12 𝒙𝟏 + 2𝑥2 + 𝒔𝟏 = 12
4𝒙𝟏 + 5𝑥2 + 𝒔𝟐 = 40 4𝒙𝟏 + 5𝑥2 + 𝒔𝟐 = 40
𝒙𝟏 + 𝑠3 = 5 𝒙𝟏 + 𝑠3 = 5
𝑍 = 0 + 5𝑥1 + 8𝑥2 𝑍 = 0 + 5𝑥1 + 8𝑥2 13
Example 1 (Stage 2)
Develop New Simplex Pivot (Q4)
2. Replace each non-pivot row i with: (aij is the value in entering
Modify the constraints such that column j of current row i )
1. The coefficients of all basic variables are 1 [new row i] = [current row i] − [(aij) x (new pivot row)]
[ 0 2 1 0 -1 7 ] ← [ 1 2 1 0 0 12] − [ 1 x [ 1 0 0 0 1 5 ] ]
2. Each constraint contains only one basic variable [ 0 5 0 1 -4 20] ← [ 4 5 0 1 0 40] − [ 4 x [ 1 0 0 0 1 5 ] ]

Tableau Basis 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 𝒔𝟑 Value Ratio


𝑐𝑗 5 8 0 0 0
0 1 2 1 0 0 12 12
Change coeff. 𝑠1
𝑠2 0 4 5 0 1 0 40 10
} non-pivot
row
of entering
variable 𝑥1 to 0 𝒔𝟑 0 1 0 0 0 1 5 5 pivot row
zero in the 𝑧𝑗 0 0 0 0 0 0
non-pivot row 𝑐𝑗 − 𝑧𝑗 5 8 0 0 0
𝑠1 0 0 2 1 0 -1 7
𝑠2 0 0 5 0 1 -4 20
st
1 𝒙𝟏 5 1 0 0 0 1 5
𝑧𝑗
𝑐𝑗 − 𝑧𝑗
𝑠𝑡 𝑠𝑡
1 1
𝐵 = {𝑠1 , 𝑠2 , 𝑥1 } 𝐵 = {𝑠1 , 𝑠2 , 𝑥1 }
𝒙𝟏 + 2𝑥2 + 𝒔𝟏 = 12 2𝑥2 + 𝒔𝟏 − 𝑠3 = 7
4𝒙𝟏 + 5𝑥2 + 𝒔𝟐 = 40 5𝑥2 + 𝒔𝟐 − 4𝑠3 = 20
𝒙𝟏 + 𝑠3 = 5 𝒙𝟏 + 𝑠3 = 5
𝑍 = 0 + 5𝑥1 + 8𝑥2 𝑍 = 0 + 5𝑥1 + 8𝑥2 14
Example 1 (Stage 2)
Develop New Simplex Pivot (Q4)
Modify the constraints such that
1. The coefficients of all basic variables are 1
2. Each constraint contains only one basic variable
Tableau Basis 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 𝒔𝟑 Value Ratio
𝑐𝑗 5 8 0 0 0
𝑠1 0 1 2 1 0 0 12 12
𝑠2 0 4 5 0 1 0 40 10
} non-pivot
row
0 𝒔𝟑 0 1 0 0 0 1 5 5 pivot row
𝑧𝑗 0 0 0 0 0 0
𝑐𝑗 − 𝑧𝑗 5 8 0 0 0
𝑠1 0 0 2 1 0 -1 7
𝑠2 0 0 5 0 1 -4 20
1st 𝒙𝟏 5 1 0 0 0 1 5
𝑧𝑗 0 0 0 0 0 0
𝑐𝑗 − 𝑧𝑗 5 8 0 0 0

1. Divide the pivot row by the pivot element to get a new pivot row
[1 0 0 0 1 5] ← [1 0 0 0 1 5] / 1
2. Replace each non-pivot row i with: (aij is the value in entering column j of current row i )
[new row i] = [current row i] − [(aij) x (new pivot row)]
[ 0 2 1 0 -1 7 ] ← [ 1 2 1 0 0 12] − [ 1 x [ 1 0 0 0 1 5 ] ]
[ 0 5 0 1 -4 20] ← [ 4 5 0 1 0 40] − [ 4 x [1 0 0 0 1 5 ] ] 15
Example 1 (Stage 2)
Develop New Simplex Pivot (Q4)
• Modify the objective function such that it does not
contain any basic variable.
Tableau Basis 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 𝒔𝟑 Value Ratio
𝑐𝑗 5 8 0 0 0
𝑠1 0 1 2 1 0 0 12 12
𝑠2 0 4 5 0 1 0 40 10
0 𝒔𝟑 0 1 0 0 0 1 5 5
𝑧𝑗 0 0 0 0 0 0
𝑐𝑗 − 𝑧𝑗 5 8 0 0 0
𝑠1 0 0 2 1 0 -1 7
𝑠2 0 0 5 0 1 -4 20
1st 𝒙𝟏 5 1 0 0 0 1 5
𝑧𝑗 5 0 0 0 5 25
𝑐𝑗 − 𝑧𝑗 0 8 0 0 -5

𝒙𝟏 = 5 − 0𝑥2 − 𝑠3 𝑍 = 5 5 − 0𝑥2 − 𝑠3 + 8𝑥2 + 0 7 − 2𝑥2 + 𝑠3


𝒔𝟏 = 7 − 2𝑥2 + 𝑠3
+0 20 − 5𝑥2 + 4𝑠3 + 0𝑠3
𝒔𝟐 = 20 − 5𝑥2 + 4𝑠3
= 0 × 7 + 0 × 20 + 5 × 5
𝑍 = 5𝑥1 + 8𝑥2 + 0𝑠1 + 0𝑠2 + 0𝑠3 +8 − 0 × 2 + 0 × 5 + 5 × 0 𝑥2 − 5𝑠3
= 25 + 8𝑥2 − 5𝑠3
16
Example 1 (Stage 2)
Develop New Simplex Pivot (Q4)

• Modify the objective function such that it does not contain


any basic variable.
Tableau Basis 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 𝒔𝟑 Value Ratio
𝑐𝑗 5 8 0 0 0
𝑠1 0 0 2 1 0 -1 7
𝑠2 0 0 5 0 1 -4 20
1st 𝒙𝟏 5 1 0 0 0 1 5
𝑧𝑗 5 0 0 0 5 25
𝑐𝑗 − 𝑧𝑗 0 8 0 0 -5

𝟎×𝟐+𝟎×𝟓+𝟓×𝟎 𝟎 × 𝟕 + 𝟎 × 𝟐𝟎 + 𝟓 × 𝟓

1. New 𝑧𝑗 row : multiplying the coefficients of basic variables


by each column, element by element and summing
[ 0 0 5 ]1×3 × [ 2 5 0 ]T3×1 = 0
2. New 𝑐𝑗 − 𝑧𝑗 row : subtracting the 𝑧𝑗 column from 𝑐𝑗
column
17
Example 1 (Stage 2)
Develop New Simplex Pivot (Q4)
• Using the equation of the leaving variable and the
entering variables to get a new basic feasible solution
Tableau Basis 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 𝒔𝟑 Value Ratio
𝑐𝑗 5 8 0 0 0
𝑠1 0 1 2 1 0 0 12 12
𝑠2 0 4 5 0 1 0 40 10
0 𝒔𝟑 0 1 0 0 0 1 5 5
𝑧𝑗 0 0 0 0 0 0
𝑐𝑗 − 𝑧𝑗 5 8 0 0 0
𝑠1 0 0 2 1 0 -1 7
𝑠2 0 0 5 0 1 -4 20
1st 𝑥1 5 1 0 0 0 1 5
𝑧𝑗 5 0 0 0 5 25
𝑐𝑗 − 𝑧𝑗 0 8 0 0 -5

𝑠𝑡
1
B0={s 1, s2, s3} B ={s1, s2, x1}
𝑍 = 0 + 5𝑥1 + 8𝑥2 𝑍 = 25 + 8𝑥2 − 5𝑠3
18
Example 1 (Stage 2)
Check whether a Basic Solution is Optimal (Q2)

• The non-basic variables are 𝑥2 , 𝑠3


• The coefficients of the non-basic variables are 8, -5;
one of them is positive
• This basic solution is not optimal
𝑠𝑡
1
Tableau Basis 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 𝒔𝟑 Value Ratio 𝐵 = {𝑠1 , 𝑠2 , 𝑥1 }
𝑐𝑗 5 8 0 0 0 2𝑥2 + 𝒔𝟏 − 𝑠3 = 7
𝑠1 0 0 2 1 0 -1 7
5𝑥2 + 𝒔𝟐 − 4𝑠3 = 20
𝑠2 0 0 5 0 1 -4 20
1st 𝑥1 5 1 0 0 0 1 5 𝒙𝟏 + 𝑠3 = 5
𝑧𝑗 5 0 0 0 5 25
𝑍 = 25 + 8𝑥2 − 5𝑠3
𝑐𝑗 − 𝑧𝑗 0 8 0 0 -5

19
Example 1(Stage 2)
Check whether a Basic Solution is Optimal (Q2)

• Final tableau
Tableau Basis 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 𝒔𝟑 Value Ratio
𝑐𝑗 5 8 0 0 0
𝑥2 8 0 1 0.5 0 -0.5 3.5
𝑠2 0 0 0 -2.5 1 -1.5 2.5
2nd 𝑥1 5 1 0 0 0 1 5
𝑧𝑗 5 8 4 0 1 53
𝑐𝑗 − 𝑧𝑗 0 0 -4 0 -1 All
Non-
𝑛𝑑 positive
• 𝐵 2
= {𝒙𝟏 , 𝒙𝟐 , 𝒔𝟐 }
• Optimal solution is
{𝑥1∗ ,𝑥2∗ ,𝑠1∗ ,𝑠2∗ ,𝑠3∗ } = {5, 3.5, 0, 2.5, 0}
𝑍 ∗ = 53
20
Example 1 (Summary of Stage 2)
Simplex method with Tableau form
Tableau Basis 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 𝒔𝟑 Value Ratio
𝑐𝑗 5 8 0 0 0
𝒔1 0 1 2 1 0 0 12 12
𝒔2 0 4 5 0 1 0 40 10
0 𝒔3 0 1 0 0 0 1 5 5
𝑧𝑗 0 0 0 0 0 0
𝑐𝑗 − 𝑧𝑗 5 8 0 0 0
𝒔1 0 0 2 1 0 -1 7 3.5
𝒔2 0 0 5 0 1 -4 20 4
1st 𝒙𝟏 5 1 0 0 0 1 5 ∞
𝑧𝑗 5 0 0 0 5 25
𝑐𝑗 − 𝑧𝑗 0 8 0 0 -5
𝒙𝟐 8 0 1 0.5 0 -0.5 3.5 Optima
𝒔2 0 0 0 -2.5 1 -1.5 2.5 {𝑥1∗ , 𝑥2∗ , 𝑠1∗ , 𝑠2∗ , 𝑠3∗ }
2nd 𝒙𝟏 5 1 0 0 0 1 5
= {5, 3.5, 0, 2.5, 0}
𝑧𝑗 5 8 4 0 1 53
𝑍 ∗ = 53
𝑐𝑗 − 𝑧𝑗 0 0 -4 0 -1
21
Example 2
Initial Tabular Form Formulation

Min Z = 𝑥1 + 𝑥2 − 3𝑥3 Max Z’ = −𝑥1 − 𝑥2 + 3𝑥3 + 0𝑠1 + 0𝑠2 − 𝑀a1 − 𝑀a2


s.t. s.t.
− 𝑥1 + 2𝑥2 − 𝑥3 ≥ -11 𝑥1 − 2𝑥2 + 𝑥3 + 𝑠1 = 11
2𝑥1 + 𝑥2 − 4𝑥3 ≥ 3 2𝑥1 + 𝑥2 − 4𝑥3 − s2 + a1 = 3
𝑥1 − 2𝑥3 = 1 𝑥1 − 2𝑥3 + a2 = 1
𝑥1 , 𝑥2 , 𝑥3 ≥ 0 𝑥1 , 𝑥2 , 𝑥3 , s1 , s2 , a1 , a2 ≥ 0

Tableau Basis 𝒙𝟏 𝒙𝟐 𝒙𝟑 𝒔𝟏 𝒔𝟐 𝒂𝟏 𝒂𝟐 Value Ratio


𝑐𝑗 -1 -1 3 0 0 -M -M
𝒔𝟏 0 1 -2 1 1 0 0 0 11
𝒂𝟏 -M 2 1 -4 0 -1 1 0 3
0 𝒂𝟐 -M 1 0 -2 0 0 0 1 1
𝑧𝑗 0 0 0 0 0 0 0 0
𝑐𝑗 − 𝑧𝑗 -1 -1 3 0 0 -M -M

22
Example 2
Initial Tabular Form Formulation
𝒁′ = −𝒙𝟏 − 𝒙𝟐 + 𝟑𝒙𝟑 + 𝟎𝒔𝟏 + 𝟎𝒔𝟐 − 𝑴𝒂𝟏 − 𝑴𝒂𝟐
⇒ 𝒁′ = −𝟒𝑴 + 𝟑𝑴 − 𝟏 𝒙𝟏 + 𝑴 − 𝟏 𝒙𝟐 + −𝟔𝑴 + 𝟑 𝒙𝟑 − 𝑴𝒔𝟐
Tableau Basis 𝒙𝟏 𝒙𝟐 𝒙𝟑 𝒔𝟏 𝒔𝟐 𝒂𝟏 𝒂𝟐 Value Ratio
𝑐𝑗 -1 -1 3 0 0 -M -M
𝒔𝟏 0 1 -2 1 1 0 0 0 11
𝒂𝟏 -M 2 1 -4 0 -1 1 0 3
0 𝒂𝟐 -M 1 0 -2 0 0 0 1 1
𝑧𝑗 0 0 0 0 0 0 0 0
𝑐𝑗 − 𝑧𝑗 -1 -1 3 0 0 -M -M

Tableau Basis 𝒙𝟏 𝒙𝟐 𝒙𝟑 𝒔𝟏 𝒔𝟐 𝒂𝟏 𝒂𝟐 Value Ratio


𝑐𝑗 -1 -1 3 0 0 -M -M
𝒔𝟏 0 1 -2 1 1 0 0 0 11
𝒂𝟏 -M 2 1 -4 0 -1 1 0 3
0 𝒂𝟐 -M 1 0 -2 0 0 0 1 1
𝑧𝑗 -3M -M 6M 0 M -M -M -4M
𝑐𝑗 − 𝑧𝑗 3M-1 M-1 -6M+3 0 -M 0 0 23
Example 2 (Stage 1)
Feasibility of a Basic Solution (Q1)
• Any basic solution having one or more negative basic
variables is infeasible
– Let the non-basic variables be zero and check the values of basic variables
B0={𝑠1 , 𝑎1 , 𝑎2 } This basic solution
𝒔𝟏 = 11 − 𝑥1 + 2𝑥2 − 𝑥3 = 𝟏𝟏 > 𝟎 is feasible
𝒂𝟏 = 3 − 2𝑥1 − 𝑥2 + 4𝑥3 + 𝑠2 = 𝟑 > 𝟎
𝒂𝟐 = 1 − 𝑥1 + 2𝑥3 = 𝟏 > 𝟎 This basic solution
𝑍′ = −4𝑀 + 3𝑀 − 1 𝑥1 + 𝑀 − 1 𝑥2 + −6𝑀 + 3 𝑥3 − 𝑀𝑠2 is feasible

Tableau Basis 𝒙𝟏 𝒙𝟐 𝒙𝟑 𝒔𝟏 𝒔𝟐 𝒂𝟏 𝒂𝟐 Value Ratio


𝑐𝑗 -1 -1 3 0 0 -M -M
𝒔𝟏 0 1 -2 1 1 0 0 0 11
𝒂𝟏 -M 2 1 -4 0 -1 1 0 3
0 𝒂𝟐 -M 1 0 -2 0 0 0 1 1
𝑧𝑗 -3M -M 6M 0 M -M -M -4M
𝑐𝑗 − 𝑧𝑗 3M-1 M-1 -6M+3 0 -M 0 0 24
Example 2 (Stage 2)
Check whether a Basic Solution is Optimal (Q2)

• The non-basic variables are 𝑥1 , 𝑥2 , 𝑥3 , 𝑠2


• The coefficients of the non-basic variables are 𝟑𝑴 − 𝟏, 𝑴 − 𝟏,
− 6𝑀 + 3, −𝑀; two of them are positive
• This basic solution is not optimal

Tableau Basis 𝒙𝟏 𝒙𝟐 𝒙𝟑 𝒔𝟏 𝒔𝟐 𝒂𝟏 𝒂𝟐 Value Ratio


𝑐𝑗 -1 -1 3 0 0 -M -M
𝒔𝟏 0 1 -2 1 1 0 0 0 11
𝒂𝟏 -M 2 1 -4 0 -1 1 0 3
0 𝒂𝟐 -M 1 0 -2 0 0 0 1 1
𝑧𝑗 -3M -M 6M 0 M -M -M -4M
𝑐𝑗 − 𝑧𝑗 3M-1 M-1 -6M+3 0 -M 0 0

25
Example 2 (Stage 2)
Select an Entering Variable (Q3)
• Maximization problem
– Select the non-basic variable with a positive coefficient in the
objective function
• 𝑥1 is a non-basic variable with a positive coefficient
B0={𝑠1 , 𝑎1 , 𝑎2 }
𝑥1 is the entering
𝑥1 − 2𝑥2 + 𝑥3 + 𝒔𝟏 = 11
variable
2𝑥1 + 𝑥2 − 4𝑥3 − 𝑠2 + 𝒂𝟏 = 3
𝑥1 − 2𝑥3 + 𝒂𝟐 = 1
𝑍′ = −4𝑀 + 3𝑀 − 1 𝑥1 + 𝑀 − 1 𝑥2 + −6𝑀 + 3 𝑥3 − 𝑀𝑠2
Tableau Basis 𝒙𝟏 𝒙𝟐 𝒙𝟑 𝒔𝟏 𝒔𝟐 𝒂𝟏 𝒂𝟐 Value Ratio
𝑐𝑗 -1 -1 3 0 0 -M -M
𝒔𝟏 0 1 -2 1 1 0 0 0 11
𝒂𝟏 -M 2 1 -4 0 -1 1 0 3
0 𝒂𝟐 -M 1 0 -2 0 0 0 1 1
𝑧𝑗 -3M -M 6M 0 M -M -M -4M
𝑐𝑗 − 𝑧𝑗 3M-1 M-1 -6M+3 0 -M 0 0
Pivot Column 26
Example 2 (Stage 2)
Decide the Leaving Variable (Q3)
• The leaving variable is the one that first goes to zero as the
value of entering variable increases from zero
– Set 𝑥1 to the maximum while maintaining all variables non-negative.

Tableau Basis 𝒙𝟏 𝒙𝟐 𝒙𝟑 𝒔𝟏 𝒔𝟐 𝒂𝟏 𝒂𝟐 Value Ratio


𝑐𝑗 -1 -1 3 0 0 -M -M
𝒔𝟏 0 1 -2 1 1 0 0 0 11 11
𝒂𝟏 -M 2 1 -4 0 -1 1 0 3 𝟑Τ𝟐
0 𝒂𝟐 -M 1 0 -2 0 0 0 1 1 1
𝑧𝑗 -3M -M 6M 0 M -M -M -4M
𝑐𝑗 − 𝑧𝑗 3M-1 M-1 -6M+3 0 -M 0 0

𝑥1 will replace 𝑎2 as
the new basic variable

27
Example 2 (Stage 2)
Develop New Simplex Pivot (Q4)

• Using the equation of the leaving variable and the


entering variables to get a new basic feasible solution
– Change the coefficients of all basic variables to be 1.
B0={𝑠1 , 𝑎1 , 𝑎2 }
𝑥1 − 2𝑥2 + 𝑥3 + 𝒔𝟏 = 11
𝒙𝟏 = 1 + 2𝑥3 − 𝑎2
2𝑥1 + 𝑥2 − 4𝑥3 − 𝑠2 + 𝒂𝟏 = 3
𝑥1 − 2𝑥3 + 𝒂𝟐 = 1
𝑍′ = −4𝑀 + 3𝑀 − 1 𝑥1 + 𝑀 − 1 𝑥2
+ −6𝑀 + 3 𝑥3 − 𝑀𝑠2
B1={𝑠1 , 𝑎1 , 𝑥1 }
−𝑎2 − 2𝑥2 + 3𝑥3 + 𝒔𝟏 = 10
−2𝑎2 + 𝑥2 − 𝑠2 + 𝒂𝟏 = 1
𝑎2 − 2𝑥3 + 𝒙𝟏 = 1
𝑍′ = − 𝑀 + 1 + −3𝑀 + 1 𝑎2
+ 𝑀 − 1 𝑥2 + 𝑥3 − 𝑀𝑠2 28
Example 2 (Stage 2)
Develop New Simplex Pivot (Q4)

• Using the equation of the leaving variable and the


entering variable to get a new basic feasible solution
Tableau Basis 𝒙𝟏 𝒙𝟐 𝒙𝟑 𝒔𝟏 𝒔𝟐 𝒂𝟏 𝒂𝟐 Value Ratio
𝑐𝑗 -1 -1 3 0 0 -M -M
𝒔𝟏 0 1 -2 1 1 0 0 0 11 11
𝒂𝟏 -M 2 1 -4 0 -1 1 0 3 3/2
0 𝒂𝟐 -M 1 0 -2 0 0 0 1 1 1
𝑧𝑗 -3M -M 6M 0 M -M -M -4M
𝑐𝑗 − 𝑧𝑗 3M-1 M-1 -6M+3 0 -M 0 0
Tableau Basis 𝒙𝟏 𝒙𝟐 𝒙𝟑 𝒔𝟏 𝒔𝟐 𝒂𝟏 𝒂𝟐 Value Ratio
𝑐𝑗 -1 -1 3 0 0 -M -M
𝒔𝟏 0 0 -2 3 1 0 0 -1 10
𝒂𝟏 -M 0 1 0 0 -1 1 -2 1
1st 𝒙𝟏 -1 1 0 -2 0 0 0 1 1
𝑧𝑗
𝑐𝑗 − 𝑧𝑗
29
Example 2 (Stage 2)
Simplex method with Tableau form
Tableau Basis 𝒙𝟏 𝒙𝟐 𝒙𝟑 𝒔𝟏 𝒔𝟐 𝒂𝟏 𝒂𝟐 Value Ratio
𝑐𝑗 -1 -1 3 0 0 -M -M
𝒔𝟏 0 0 -2 3 1 0 0 -1 10 -5
𝒂𝟏 -M 0 1 0 0 -1 1 -2 1 1
1st 𝒙𝟏 -1 1 0 -2 0 0 0 1 1 +∞
𝑧𝑗 -1 -M 2 0 M -M 2M-1 -M-1
𝑐𝑗 − 𝑧𝑗 0 M-1 1 0 -M 0 -3M+1

Tableau Basis 𝒙𝟏 𝒙𝟐 𝒙𝟑 𝒔𝟏 𝒔𝟐 𝒂𝟏 𝒂𝟐 Value Ratio


𝑐𝑗 -1 -1 3 0 0 -M -M
𝒔𝟏 0 0 0 3 1 -2 2 -5 12 4
𝒙𝟐 -1 0 1 0 0 -1 1 -2 1 +∞
nd
2 𝒙𝟏 -1 1 0 -2 0 0 0 1 1 -1/2
𝑧𝑗 -1 -1 2 0 1 -1 1 -2
𝑐𝑗 − 𝑧𝑗 0 0 1 0 -1 -M+1 -M-1

Tableau Basis 𝒙𝟏 𝒙𝟐 𝒙𝟑 𝒔𝟏 𝒔𝟐 𝒂𝟏 𝒂𝟐 Value Ratio


𝑐𝑗 -1 -1 3 0 0 -M -M
𝒙𝟑 3 0 0 1 1/3 -2/3 2/3 -5/3 4
𝒙𝟐 -1 0 1 0 0 -1 1 -2 1 optimal
3rd 𝒙𝟏 -1 1 0 0 2/3 -4/3 4/3 -7/3 9 solution
𝑧𝑗 -1 -1 3 1/3 1/3 -1/3 -2/3 2
𝑐𝑗 − 𝑧𝑗 0 0 0 -1/3 -1/3 -M+1/3 -M+2/3
30
Special Cases of Linear Programs

Case I: Infeasibility

Case II: Unbounded LP

Case III: Alternate Optima

31
Special Case I: Infeasibility
An Example
Infeasibility occurs if the solution reaches optimality but
an artificial variable remains positive in the final tableau
General form of an LP problem Standard form of an LP problem

Max 3𝑥1 + 5𝑥2 Max 𝑍 = 3𝑥1 + 5𝑥2 + 0𝑠1 + 0𝑠2 − 𝑀𝑎1


s.t. s.t.
𝑥1 + 𝑥2 ≤ 3 𝑥1 + 𝑥2 + 𝑠1 =3
𝑥1 + 𝑥2 ≥ 5 𝑥1 + 𝑥2 − 𝑠2 + 𝑎1 = 5
𝑥1 , 𝑥2 ≥ 0 𝑥1 , 𝑥2 , 𝑠1 , 𝑠2 , 𝑎1 ≥ 0
𝐵0 = 𝑠1 , 𝑎1
𝑥1 + 𝑥2 + 𝒔𝟏 = 3, 𝑠1 ≥ 0 requires 𝑥2 ≤ 3 𝒔𝟏 leaving
𝑥1 + 𝑥2 − 𝑠2 + 𝒂𝟏 = 5, 𝑎1 ≥ 0 requires 𝑥2 ≤ 5 𝒙𝟐 entering
𝑍 = 3𝑥1 + 5𝑥2 − 𝑀𝑎1 = −5𝑀 + 𝑀 + 3 𝑥1 + 𝑀 + 5 𝑥2 − 𝑀𝑠2 32
Special Case I: Infeasibility
An Example
𝐵0 = 𝑠1 , 𝑎1
𝑥1 + 𝑥2 + 𝒔𝟏 = 3
𝑥1 + 𝑥2 − 𝑠2 + 𝒂𝟏 = 5
𝑍 = −5𝑀 + 𝑀 + 3 𝑥1 + 𝑀 + 5 𝑥2 − 𝑀𝑠2
𝒙𝟐 = 3 − 𝑥1 − 𝑠1
𝐵1 = 𝑥2 , 𝑎1
𝑥1 + 𝒙𝟐 + 𝑠1 = 3
𝒂𝟏 − 𝑠1 − 𝑠2 = 2 No entering variable
𝑍 = −2𝑀 + 15 − 2𝑥1 − 𝑀 + 5 𝑠1 − 𝑀𝑠2

𝑎1 = 2 + 𝑠1 + 𝑠2 𝒂𝟏 is positive, hence the


=2 problem is infeasible
33
Special Case I: Infeasibility
An Example

Infeasibility is detected in the simplex method when an


artificial variable remains positive in the final tableau.

Tableau Basis 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 𝒂𝟏 Value Ratio

𝑐𝑗 3 5 0 0 -M
𝑥2 5 1 1 1 0 0 3
𝑎1 -M 0 0 -1 -1 1 2
1st
𝑧𝑗 5 5 M+5 M -M -2M+15
𝑐𝑗 − 𝑧𝑗 -2 0 -M-5 -M 0

Optimal but 𝑎1 remains basic or positive.

34
Special Case II: Unbounded LP

• If all coefficients in an entering column of an entering


variable are non-positive, then
– Unbounded feasible region and
– the optimal objective goes to infinity

Basis 𝒙𝟏 … Value

𝑐𝑗 6 …
𝑥2 8 -3 … 8 The coefficients of the
entering column are all
… 0 -2 … 4
non-positive
𝑠1 0 0 … 5

𝑧𝑗 -24 …

𝑐𝑗 − 𝑧𝑗 30 …

35
Special Case II: Unbounded LP
An Example
max 𝑍 = 2𝑥1 + 3𝑥2 𝑍 = 2𝑥1 + 3𝑥2 𝑥2
s.t. 𝑥 − 𝑥 ≤ 3 𝑥1 − 𝑥2 + 𝒔𝟏 = 3
1 2
𝑥1 ≤4 𝑥1 + 𝒔𝟐 = 4 𝑥1 ≤ 4

Basis 𝒙𝟏 𝒙𝟐 𝑠1 𝑠2 Value
𝑥1 − 𝑥2 ≤ 3
𝑐𝑗 2 3 0 0
𝑠1 0 1 -1 1 0 3 𝑍 = 2𝑥1 + 3𝑥2
𝑠2 0 1 0 0 1 4
0
0 0 0 0 0 𝑥1
𝑧𝑗 0
𝑐𝑗 − 𝑧𝑗 2 3 0 0

If x2 is chosen to be the entering


variable, then all coefficients in the
entering column of x2 are non-positive
36
Special Case II: Unbounded LP
An Example

max 𝑍 = 2𝑥1 + 3𝑥2 𝑍 = 2𝑥1 + 3𝑥2 𝑥2


s.t. 𝑥 − 𝑥 ≤ 3 𝑥1 − 𝑥2 + 𝒔𝟏 = 3
1 2
𝑥1 ≤4 𝑥1 + 𝒔𝟐 = 4 𝑥1 ≤ 4

Basis 𝒙𝟏 𝒙𝟐 𝑠1 𝑠2 Value
𝑥1 − 𝑥2 ≤ 3
𝑐𝑗 2 3 0 0
𝑥1 2 1 0 0 1 4 𝑍 = 2𝑥1 + 3𝑥2
𝑥2 3 0 1 -1 1 1 0
𝑥1
𝑧𝑗 2 3 -3 5 11 0
𝑐𝑗 − 𝑧𝑗 0 0 3 -5 If x1 is first chosen to be
Tableau entering variable, then
after two 1st iteration: x1 in, s1 out
iterations 2nd iteration: x2 in, s2 out
All coefficients in the entering
column of s1 are non-positive
37
Special Case III: Alternate Optima
An Example
• If the coefficients of some non-basic 𝑥2
variables are 0 and those of other
non-basic variables are all negative 𝑥1 ≤ 4
in the objective function, this basic
solution is optimal and this problem
has alternate optima
𝑥1 + 2𝑥2 ≤ 10
max 𝑍 = 𝑥1 + 2𝑥2 𝑍 = 0 + 𝑥1 + 2𝑥2
s.t. 𝑥 + 2𝑥 ≤ 10 𝑥1 + 2𝑥2 + 𝒔𝟏 = 10 𝑍 = 𝑥1 + 2𝑥2
1 2
𝑥1 ≤4 𝑥1 + 𝒔𝟐 = 4 0
0 𝑥1

𝑍 = 10 − 1.0𝑠1 − 0.0𝑠2

Final Tableau: 𝑥1 = 4 − 𝑠2
1 1
𝑥2 = 3 − 𝑠1 + 𝑠2
2 2
38
Special Case III: Alternate Optima
An Example
Alternate optima exist if a non-basic variable in the final
tableau has a 𝑐𝑗 − 𝑧𝑗 value equal to 0.
𝑥2
Basis 𝒙𝟏 𝒙𝟐 𝑠1 𝒔𝟐 Value

𝑐𝑗 1 2 0 0
𝑥1 1 1 0 0 1 4
1 1
𝑥2 2 0 1 − 3
2 2
𝑧𝑗 1 2 1.0 0 10

𝑐𝑗 − 𝑧𝑗 0 0 -1.0 0 0
0 𝑥1

𝑠2 , a non-basic variable, has a zero


value of 𝑐𝑗 − 𝑧𝑗 in the final tableau
39
Summary of Processes of Simplex Tableau

Set up the
initial tableau

Compute Alternate
Infeasibility
𝑐𝑗 − 𝑧𝑗 optima

Yes Yes
Optimality Yes Infeasibility No Alternate optima No Unique
check check check optima
No
Yes
Unboundedness Unboundedness
check
No

Compute new
tableau

40

You might also like