Points to Remember in Simplex Algorithm
All the constraints should be type.
All variables should be 0.
Coefficients of basic variables in z-row should be zero.
The coefficients matrix corresponding to initial basic
variables forms an identity matrix.
The entering variable will be the one which has most
negative (most positive) z-row coefficient in case of max.
(min.) problem.
Manoj Kumar Pandey, 1
OPTIMIZATION
Points to Remember ..
Leaving variable should follow the minimum ratio test.
When all the z-row coefficients are 0 (or 0) in case of
max. (or min.) problem the optimality is reached and we
will stop the simplex iteration.
Manoj Kumar Pandey, 2
OPTIMIZATION
Example 4: Solve the LPP using simplex method
Maximize Z = x + 5y
Subject to: -x + 3y 10
x+y 6
x-y 2
x0 y0
Dr. Manoj Kumar Pandey
In the standard simplex table
The coefficients of the basic variables in the z-row
should be zero.
The respective coefficients in the constraint matrix
must be identity coefficients.
In case it is not we have to use elementary row
operations to keep it in the standard simplex form
before we apply the simplex method
4
Example 5: Solve the following LPP using simplex
method
Maximize z = 2 x1 + 4 x2 + 4 x3 3x4
Subject to
x1 + x2 + x3 4
x1 + 4 x2 + x4 = 8
x1 , x2 , x3 , x4 0
Contents
Artificial Variables Techniques
Big M Method
Two Phase Method
6
If in a starting simplex tableau, we dont have an
identity sub matrix (i.e. an obvious starting BFS), then
we introduce artificial variables to have a starting BFS.
This is known as artificial variable technique.
There are two methods to find the starting BFS and
solve the problem
(1) Big M Method
(2) Two-Phase Method.
7
Big M Method
8
Suppose that ith constraint equation doesn't have a
slack variable. i.e.
ith constraint in the original LPP is either or = type .
Then an artificial variable Ri is added, to form the ith
unit vector column.
Since the artificial variables are not part of the
original LPP, they are assigned a very high penalty in
the objective function and thus forcing them to equal
zero in the optimum solution.
9
Artificial variable objective coefficient
= - M (Sum of artificial variables) in a maximization
problem,
= M (sum of the artificial variables ) in a minimization
problem
where M is a very large positive number.
Mathematically M
10
Example 1
Min z = 4x1 + 3x2
Subject to
2x1 + x2 10
x1 + x2 6
-3x1 + 2x2 6
Writing z as equation and adding
x10, x20 slack and surplus variables to the
constraints
z 4x1 3x2 =0
2x1 +x2 S1 = 10
x1 + x2 - S2 =6
-3x1 + 2x2 + S3 = 6
11
Addition of artificial variables to obtain a starting BFS
2x1 + x2 S1 +R1 = 10 Artificial variables
R1 and R2 added to
x1 + x2 S2 +R2 = 6 the constraints
- 3x1 + 2x2 + S3 = 6
These artificial variables are penalized in the objective
function by assigning some very large value (say M) to
them in the objective function
12
z = 4x1 + 3x2 + MR1 + MR2 Objective function
2x1 + x2 s1 +R1 = 10
x1 + x2 s2 +R2 =6 constraints
- 3x1 + 2x2 + s3 =6
Where M is a very large penalty assigned on
artificial variables R1 and R2
13
Tabular form
Basic z x1 x2 S1 S2 R1 R2 S3 solution
z 1 -4 -3 0 0 -M -M 0 0
R1 0 2 1 -1 0 1 0 0 10
R2 0 1 1 0 -1 0 1 0 6
S3 0 -3 2 0 0 0 0 1 6
14
Since the z column does not change in the iterations, it may be
deleted
Basic x1 x2 S1 S2 R1 R2 S3 solution
z -4 -3 0 0 -M -M 0 0
R1 2 1 -1 0 1 0 0 10
R2 1 1 0 -1 0 1 0 6
S3 -3 2 0 0 0 0 1 6
The initial BFS as obtained from the table is
R1 = 10; R2 = 6 and z = 0 Is this table
correct ?
15
But if R1 = 10; R2 = 6 then the value of
objective function should be z = 16 M, since
we have defined the objective function as:
z = 4x1 + 3x2 + MR1 + MR2
Why does this inconsistency appears?
This is because of the fact that the elements
of the basic variable have a non zero
coefficient in the z-row.
The starting table now becomes
16
Basic x1 x2 S1 S2 R1 R2 S3 solution
z -4 + 3M -3+2M -M -M 0 0 0 16M
R1 2 1 -1 0 1 0 0 10
R2 1 1 0 -1 0 1 0 6
S3 -3 2 0 0 0 0 1 6
Apply the basic simplex method for solving
minimization problem
17
Selecting pivot row and pivot column for a minimization problem
Basic x1 x2 S1 S2 R1 R2 S3 solution Min.
ratio
z -4 + 3M -3+2M -M -M 0 0 0 16M
R1 2 1 -1 0 1 0 0 10
2 10/2
R2 1 1 0 -1 0 1 0 6
6/1
S3 -3 2 0 0 0 0 1 6 ---
Select the most positive element of the z row
18
Second iteration
Bas x1 x2 S1 S2 R1 R2 S3 solution Min.
ic ratio
z 0 -2+M -4-M -M 4 3M 0 0 20 +M
2 2 2
x1 1 1/2 -1/2 0 1 0 0 5 5/1/2
R2 0 1/2 1/2 -1 0 1 0 1
1/2 1/1/2
S3 0 7/2 -3/2 0 0 0 1 21 21/7/2
19
Final iteration
Basic x1 x2 S1 S2 R1 R2 S3 solution
z 0 0 -1 -2 1M (2-M)/2 0 22
x1 1 0 -1 0 1 0 0 4
x2 0 1 1 -1 0 1 0 2
S3 0 0 -13/2 0 0 0 1 14
Solution x1 = 4; x2 = 2; z = 22
20
Consider the following LPP:
Maximize z = 2 x1 + 3 x 2 5 x3
Subject to x1 + x 2 + x3 = 7
2 x1 5 x 2 + x3 10
x1 , x 2 , x3 0
21
Introducing surplus and artificial variables, s2, R1 and R2 , the
LPP is modified as follows:
Maximize z = 2 x1 + 3 x 2 5 x3 MR1 MR 2
Subject to x1 + x2 + x3 + R1 = 7
2 x1 5 x 2 + x 3 s 2 + R2 = 10
x1 , x 2 , x 3 , s 2 , R 1 , R 2 0
Now we solve the above LPP by the Simplex method.
22
Basic z x1 x2 x3 s2 R1 R2 Sol.
-2-3M -3+4M 5-2M M 0 0 -17M
z 1 -2 -3 5 0 M M 0
R1 0 1 1 1 0 1 0 7
R2 0 2 -5 1 -1 0 1 10
z 1 0 -8 - 6- -1 - 0 1+ 10 -
7M/2 M/2 M/2 3M/2 2M
R1 0 0 7/2 1/2 1/2 1 -1/2 2
x1 0 1 -5/2 1/2 -1/2 0 1/2 5
z 1 0 0 50/7 1/7 16/7 + -1/7 102/7
M +M
x2 0 0 1 1/7 1/7 2/7 -1/7 4/7
x1 0 1 0 6/7 -1/7 5/7 1/7 45/7
The optimum (Maximum) value of
z = 102/7
and it occurs at
x1 = 45/7, x2 = 4/7, x3 = 0
24
If in any iteration, there is a tie for leaving variable
between an artificial variable and other variable
(decision, surplus or slack), we must prefer the
artificial variable to leave the basis.
An artificial variable is never considered for re-entry
into the basis.
If in the final optimal tableau, an artificial variable is
present in the basis at a non-zero level, this means our
original problem has no feasible solution.
25
Tutorial - 3
26
(1). Solve the following LPPs using Simplex method:
(i) Max. z = 1 2 x1 1 5 x 2
subject to 4 x1 + 3 x 2 12
2 x1 + 5 x 2 1 0
x1 , x 2 0
(ii) Max. z = 2 x1 3 x 2
subject to x 1 + x 2 2
2 x1 x 2 2
x1 x 2 2
x1 0 , x 2 u n re s tric e d
27
(iii) Max. z = 3 x1 + 2 x 2 + 5 x 3
subject to x1 + 2 x 2 + x 3 4 3 0
3 x1 2 x 3 4 6 0
x1 + 4 x 2 4 2 0
x1 , x 2 , x 3 0
(iv) Min. z = 6 x1 2 x 2 6 x 3
subject to 2 x1 3 x 2 + x 3 1 4
4 x1 + 4 x 2 + 1 0 x 3 4 6
2 x1 + 2 x 2 4 x 3 3 7
x1 2 , x 2 1, x 3 3
28
(2). Solve the following LPPs using Big-M method:
(i) Max. z = x1 + 3 x 2
subject to x1 + 2 x 2 2
3 x1 + x 2 3
x1 4
x1 , x 2 0
(ii) Min. z = 9 x1 + x 2 + 2 x 3
subject to 4 x 1 + 2 x 2 + x 3 5
x1 + 2 x 2 + 3 x 3 4
x1 , x 2 , x 3 0
29