Lec5-Regular Simplex Method and Dual Simplex Method
Lec5-Regular Simplex Method and Dual Simplex Method
Lecture 5
Regular Simplex Method
if yes stop
if no
≤ + slack (s)
= + Artificial (A)
Simplex method in tabular form
2. Construct the initial simplex tableau
S1 0 1 0 1 0 0 4 -
Initial Basic S2 0 0 2 0 1 0 12 6
Variables
S3 0 3 2 0 0 1 18 9
-3 -5 0 0 0 0
Basic X1 X2 S1 S2 S3 RHS
variable 3 5 0 0 0
Note that X2
becomes in the S1 0 0
basic variables list
instead of S2 X2 5 0 1 0 1/2 0 6
S3 0 0
Z 0
𝟎
SO its coefficient in the Tableau must be 𝟏
𝟎
First Iteration Basic X1 X2 S1 S2 S3 RHS
variable 3 5 0 0 0
For S3
S1 0 1 0 1 0 0 4
X2 5 0 1 0 1/2 0 6
3 2 0 0 1 18
-
S3 0 3 2 0 0 1 18
2 (0 1 0 1/2 0 6)
3 0 0 -1 1 6
Basic X1 X2 S1 S2 S3 RHS
variable 3 5 0 0 0
S1 0 1 0 1 0 0 4
X2 5 0 1 0 1/2 0 6
Substitute this values S3 0 3 0 0 -1 1 6
in the table
Second Iteration
This solution is not optimal, since there is a negative
numbers in the last row
Basic X1 X2 S1 S2 S3 RHS ratio
variable 3 5 0 0 0
S1 0 1 0 1 0 0 4 4
X2 5 0 1 0 1/2 0 6 -
S3 0 3 0 0 -1 1 6 2
Z -3 0 0 5/2 0 30
Basic X1 X2 S1 S2 S3 RHS
variable 3 5 0 0 0
S1 0 0 0 1 1/3 -1/3 2
X2 5 0 1 0 1/2 0 6
X1 3 1 0 0 -1/3 1/3 2
Z 0 0 0 3/2 1 36
This solution is optimal; since there is no negative numbers in the last row:
basic variables are X1 = 2, X2 = 6 and S1 = 2; the non-basic variables are
S2 = S3 = 0 then Z = 36
This Solution is Unique Since the 𝑵𝒖𝒎𝒃𝒆𝒓 𝒐𝒇 𝒁𝒆𝒓𝒐𝒆𝒔 𝒊𝒏 𝒕𝒉𝒆 𝑳𝒂𝒔𝒕 𝑹𝒐𝒘 =
𝑻𝒉𝒆 𝒏𝒖𝒎𝒃𝒆𝒓 𝒐𝒇 𝑩𝒂𝒔𝒊𝒄 𝑽𝒂𝒓𝒊𝒂𝒃𝒍𝒆𝒔
Special cases of linear programming
• Infeasible solution
• Multiple solution (infinitely many solution)
• Unbounded solution
• Degenerated solution
Special cases
• In the final tableau, if one or more artificial variables (A1, A2, …)
still basic and has a nonzero value, then the problem has an
infeasible 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 zeroes), then the solution is unbounded.
• A Solution that has a basic variable with zero value is called a
“degenerate solution”.
• If there is a zero under one or more nonbasic variables in the last
tableau (optimal solution tableau), then there is a multiple
optimal solution.
Simplex method incase of Artificial variables
“Big M method”
• Solve the following linear programming problem by using
the simplex method:
• Min Z =2 X1 + 3 X2
Subject to
½ X1 + ¼ X2 ≤ 4
X1 + 3X2 20
X1 + X2 = 10
X1, X2 0
Big M method
• Solution
Step 1: standard form
Min : Z =2 X1 + 3 X2 +0 S1 + 0 S2 + M A1 +M A2
Subject to
½ X1 + ¼ X 2 + S 1 =4
X1 + 3X2 - S2 + A1 = 20
X1 + X 2 + A2 = 10
X1, X2 ,S1, S2, A1, A2 0
Where: M is a very large number
Big M method
• Step 2: Initial tableau
Basic X1 X2 S1 S2 A1 A2 RHS
variables 2 3 0 0 M M
S1 0 ½ ¼ 1 0 0 0 4
A1 M 1 3 0 -1 1 0 20
A2 M 1 1 0 0 0 1 10
Z 2-2M 3-4M 0 M 0 0
Big M method
• The initial tableau will be:
Most negative
• Since there is a negative value in the last row, this solution is not optimal
• The entering variable is X1 (it has the most negative value in the last row)
• The leaving variable is A2 (it has the smallest ratio)
Big M method
• Second iteration
Basic X1 X2 S1 S2 A1 A2 RHS
variables 2 3 0 0 M M
𝑥1 𝑥2 𝑥3 𝑠1 𝑠2 RHS Ratio
2 2 4 0 0
𝑠1 0 5/4 0 1/2* 1 1/4 0 0
Multiply by -1 𝑥2 2 3/4 1 1/2 0 -1/4 2 4
-1/2 0 -3 0 -1/2
Regular Simplex Method (Using of Artificial Variables)
5- Improving the optimality:-
𝑥1 𝑥2 𝑥3 𝑠1 𝑠2 RHS Ratio
2 2 4 0 0
Multiply by 2 𝑠1 0 5/4 0 1/2* 1 1/4 0 0
+ 𝑥2 2 3/4 1 1/2 0 -1/4 2 4
-1/2 0 -3 0 -1/2
𝑥1 𝑥2 𝑥3 𝑠1 𝑠2 RHS
2 2 4 0 0
Multiply by -1/2 𝑥3 4 5/2 0 1 2 1/2 0
𝑥2 2 -1/2 1 0 -1 -1/2 2
7 0 0 6 1
Regular Simplex Method
Using of Artificial Variables
• The optimal solution is at :
𝑥1 = 0, 𝑥2 = 2, 𝑥3 = 0, 𝑠1 = 0, 𝑠2 = 0, 𝐴1 = 0
1. In any Simplex tableau, the intersection of any basic variable with itself is always
one and the rest of the column is zeroes.
2. In any simplex tableau, the objective function row (Z row) is always in terms of
the nonbasic variables. This means that under any basic variable (in any tableau)
there is a zero in the last row. For the non basic there is no condition ( it can take
any value in this row).
3. If there is a tie (more than one variables have the same most negative or positive)
in determining the entering variable, choose any variable to be the entering one.
6. If there is a tie in determining the leaving variable, choose any one to be the
leaving variable. In this case a zero will appear in RHS column; therefore, a
“cycle” will occur, this means that the value of the objective function will be the
same for several iterations.
Regular Simplex Method
Number of zeroes in the
last row = Number of basic
variables
(Unique Solution)
The artificial
Number of zeroes in
variable has a non
the last row > Number
zero value in the
final tableau
RSM of basic variables
There is no positive
numbers in the
work column
(Unbounded
Solution)
Definitions
• A basic solution is an augmented corner point solution.
• A basic solution has the following properties:
1. Each variable is designated as either a nonbasic variable or a basic variable.
2. The number of basic variables equals the number of functional constraints.
Therefore, the number of nonbasic variables equals the total number of
variables minus the number of functional constraints.
3. The nonbasic variables are set equal to zero.
4. The values of the basic variables are obtained as simultaneous solution of
the system of equations (functional constraints in augmented form). The set
of basic variables are called “basis”
5. If the basic variables satisfy the nonnegativity constraints, the basic solution
is a Basic Feasible (BF) solution.
How to be efficient?
Dual Simplex Method
Dual Simplex Method condition
Case1: If it is maximize then all the cost coefficient must be negative
Example:
Maximize: 𝒁 = −𝟐𝒙𝟏 − 𝟓𝒙𝟐 − 𝟏𝟐𝒙𝟑 so the super optimal solution for Z is Zero
which is satisfied from the initial basic solution where
𝑥1 = 𝑥2 = 𝑥3 = 0
OR
Case2: If it is Minimize then all the cost coefficient must be Positive
Minimize: 𝒁 = 𝟐𝒙𝟏 + 𝟓𝒙𝟐 + 𝟏𝟐𝒙𝟑 so the super optimal solution for Z is Zero
which is satisfied from the initial basic solution where
𝑥1 = 𝑥2 = 𝑥3 = 0
Dual Simplex Method Steps
1. Turn all constraints into less than or equal constraints.
2. Determine the output variable which has the most negative number
in RHS.
3. Determine the input variable by calculating the ratio between the
last row and the magnitude of negative numbers only in the pivot
row, then consider the input variable is the one that has the smallest
ratio.
4. Apply the same rules as in the regular simplex method until RHS has
no negative numbers.
-- -
-
Example 1 cont…
=
Entering Variable
Leaving Variable 0
0
4 6 18 0 0
6/1=6 18/2=9
Min ratio
Entering Variable
Ci -6 -4 -18 0 0
Leaving
Variable 0
-4
6 0 10 0 4
Ratio 6/1 10/3
R1*-1/3
R2+2/3R1 Min Ratio
Ci -6 -4 -18 0 0
Example 2: Dual Simplex Method
Entering
Variable
𝑿𝟏 𝑿𝟐 𝑠1 𝑠2
-3 -1 0 0
𝑠1 0 -1 -1 1 0 -1
Most
Departing 𝑠2 0 -2 −𝟑∗ 0 1 -2 negative
Variable 3 1 0 0
Ratio 3/2 1/3
Min Ratio
7/3 0 0 1/3
Entering
Variable
𝑿𝟏 𝑿𝟐 𝑠1 𝑠2
-3 -1 0 0 Most
∗
𝑠1 0 -1/3 0 1 −𝟏/𝟑 -1/3 negative
Departing
Variable 𝑿𝟐 -1 2/3 1 0 -1/3 2/3
7/3 0 0 1/3
This is the final table where the solution
Ratio 7 1 is optimal feasible
The soln is 𝑿𝟏 =0 , 𝑿𝟐 =1 , 𝑠1 = 0, 𝑠2 =1,
Min Ratio Z=-1
𝑿𝟏 𝑿𝟐 𝑠1 𝑠2 𝑿𝟏 𝑿𝟐 𝑠1 𝑠2
-3 -1 0 0 -3 -1 0 0
R1*-3
𝑠2 0 1 0 -3 1 1 R2+1/3R1 𝑠2 0 1 0 -3 𝟏 1
𝑿𝟐 -1 2/3 1 0 -1/3 2/3 𝑿𝟐 -1 1 1 -1 0 1
2 0 1 0