Simplex Method
RK Jana
1
Lecture Outline
Mathematical fundamentals of LPP
Slack, surplus and artificial variables
Computational procedure of Simplex Method
Justification & significance of elements in Simplex
tableau
Solving maximization and minimization LPP
Technical issues involved in Simplex Method
Software for solving LPP
Mathematical Fundamentals of LPP
Corner-point Solution
A corner-point is the point defined by the
intersection of constraint boundaries
In two dimensions – intersection of two lines
In higher dimensions – intersection of n (n-1)
dimensional “hyperplanes”
The corner-point solution
Feasible
Infeasible
4
Example
Maximize Z = 3x1 + 5x2
Subject to
x1 4
2x2 12
3x1 + 2x2 18
x1 , x2 0
5
Corner-points Highlighted
x2 3x1+2x2=18 Both corner-point feasible and
(0, 9)
infeasible solutions are shown.
x1=4
(2, 6) (4, 6)
(0, 6) 2x2=12
(4, 3)
(4, 0) and (2, 6) are adjacent to (4, 3)
(0, 0)
(4, 0) (6, 0) x1
6
Properties of Corner-Point
Solutions
1. If there is exactly one optimal solution, then
it must be a corner-point solution
2. If there are multiple optimal solutions, then
at least two solutions are adjacent corner-
point solutions
3. There are a finite number of corner-point
feasible solutions
4. If a corner-point feasible solution has no
better adjacent corner-point feasible
solution, then it is optimal
7
The Simplex Method
When decision variables are more than 2, it is always advisable
to use Simplex Method to avoid lengthy graphical procedure.
The simplex method is not used to examine all the feasible
solutions.
It deals only with a small and unique set of feasible solutions, the
set of vertex points (i.e., extreme points) of the convex feasible
space that contains the optimal solution.
The simplex method is a method for searching corner point
feasible solutions
8
Continued…
Locate an extreme point of the feasible region
Examine each boundary edge intersecting at this point to
see whether movement along any edge increases the value
of the objective function
If the value of the objective function increases along any
edge, move along this edge to the adjacent extreme point. If
several edges indicate improvement, the edge providing the
greatest rate of increase is selected
Repeat second & third steps above until movement along
any edge no longer increases the value of objective function
9
Geometric Interpretation
The Simplex method starts at a corner-point feasible
solution (usually the origin) and moves to adjacent CP
solutions along edges until an optimal solution is found.
A CPF solution is connected to adjacent CPF solutions by
edges
In a problem with n decision variables, each CPF solution
will have n edges emanating from it
10
Continued…
A CPF solution lies at the intersection of n constraint
boundaries.
By relaxing a single constraint boundary equation (i.e.
equality for the constraint is relaxed) an edge is defined
which leads to an adjacent CPF solution.
The simplex method defines
How to choose which edge to traverse.
When to stop or how to determine that a CPF solution is optimal
11
Identifying Solution Type
Using Simplex Method
Bounded feasible region exists
If there is exactly one optimal solution, then it can
find the solution efficiently
If there are multiple optimal solutions, then it can
identify the case & can find all solutions
No bounded feasible region exists
Unbounded feasible region can be identified
No feasible region can be identified
12
Slack, surplus and artificial
variables
Slack Variable
Surplus Variable
Artificial Variable
13
Computational Procedure of
Simplex Method
LPP in Vector Notations
Maximize Z = cx
subject to
Ax = b, x 0
where c = (c1, c2, …, cj, …, cn)
x = (x1, x2, …, xj, …, xn)T
A = (a1, a2, …, aj, …, an)
b = (b1, b2, …, br…, bm)T
15
Notations
aj = a column vector whose elements are
coefficients of xj in A
B = initial basis containing m-columns of A
xB = initial basic feasible solution
b = requirement vector
16
Initial Simplex Table
cj c1 c2 … cn
cB xB b x1 x2 … xn
cB1 xB1 b1 a11 a12 … a1n
cB2 xB2 b2 a21 a22 … a2n
… … … … … … …
cBm xBm bm am1 am2 … amn
z j – cj z 1 – c1 z2 –c2 … z n – cn
zj – cj = cB aj - cj= cB1 a1j + cB2 a2j + … + cBm amj - cj 17
Characteristics
Objective value
Z = cB xB = cB1 xB1 + cB2 xB2 + … + cBm xBm
The Quantity Zj
zj = cB aj = cB1 a1j + cB2 a2j + … + cBm amj
18
Characteristics
Net evaluation
zj – cj = cB aj - cj= cB1 a1j + cB2 a2j + … + cBm amj – cj
Optimality condition: zj - cj 0
Unbounded solution: zj - cj 0 and aij 0
19
Characteristics
Alternate optimal solution
zj - cj =0for some non-basic variable & aij 0
for at least one j
No feasible solution
If at any stage of the simplex method the optimality
condition is satisfied and still at least one artificial
variable remains in the basis at the positive level, then
the LPP has no feasible solution.
20
Entering & Departing Vector Rules
(maximization problem)
Entering Vector Rule (1):
xk will enter the basis based on the condition:
zk - ck = Minj { zj - cj | zj - cj 0 }
Departing Vector Rule (2):
xr will leave the basis based on the condition:
Mini { xBi / aij | aij 0 }
21
Simplex Algorithm
(for a maximization problem)
Step 1: If the given LPP is of minimization type, then
convert it to a maximization type problem.
Step 2: If any of the components of the requirement
vector is negative, multiply the corresponding
constraint by (-1) and adjust the direction of inequality.
If the constraint is an equality then multiply it by (-1)
only.
Step 3: Add slack, surplus & artificial variables to the
constraints according to their requirement.
22
Continued…
Step 4: Assign coefficients of slack & surplus variable
as 0, and (-M) for artificial variables in the changed
objective function.
Step 5: Construct the simplex table by choosing the
initial basic feasible solution.
Step 6: Check the optimality of solution. If all
(zj - cj 0 ), then the present solution is optimal.
Step 7: If for at least one aj , zj - cj 0 and aij 0 then
the problem has unbounded solution and stop there.
23
Continued…
Step 8: Choose the entering vector according to Rule
1. In case of tie, chose any one arbitrarily.
Step 9: Choose the departing vector according to Rule
2. In case of tie, chose any one arbitrarily.
Step 10: Form the new basis by dropping the departing
variable and introducing the new variable. Convert the
key element to unity and all other elements in its
column to zero.
Step 11: Go to Step 6 and repeat the procedure until
either an optimum solution is obtained or there is an
indication of unbounded solution.
24
Example
Max Z = x1 + x2 + 3x3
subject to
3x1 + 3x2 + x3 3
2x1 + x2 + 2x3 2
x1 , x2, x3 0
25
Continued…
Max Z = x1 + x2 + 3x3 + 0.s1 + 0.s2
subject to
3x1 + 3x2 + x3 + 1.s1 + 0.s2 =3
2x1 + x2 + 2x3 + 0.s1 + 1.s2 =2
x1, x2, x3, s1, s2 0
26
Continued…
Table 1
cj 1 1 3 0 0
cB xB b x1 x2 x3 s1 s2
0 s1 3 3 3 1 1 0
0 s2 2 2 1 2 0 1
zj – c j -1 -1 -3 0 0
27
Continued…
Table 2
cj 1 1 3 0 0
cB xB b x1 x2 x3 s1 s2
0 s1 2 2 5/2 0 1 -1/2
3 x3 1 1 1/2 1 0 1/2
zj – cj 2 1/2 0 0 3/2
Optimum solution: x1 = x2 = 0, x3 = 1, max Z = 3
28
Example
Max Z = 3x1 + 2x2 + x3
subject to
3x1 + 4x2 + 3x3 42
5x1 + 3x3 45
3x1 + 6x2 + 2x3 41
x1 , x2, x3 0
29
Continued…
Table 1
cj 3 2 1 0 0 0
cB xB b x1 x2 x3 s1 s2 s3
0 s1 42 3 4 3 1 0 0
0 s2 45 5 0 3 0 1 0
0 s3 41 3 6 2 0 0 1
zj – cj -3 -2 -1 0 0 0
30
Continued…
Table 2
cj 3 2 1 0 0 0
cB xB b x1 x2 x3 s1 s2 s3
0 s1 15 0 4 6/5 1 -3/5 0
3 x1 9 1 0 3/5 0 1/5 0
0 s3 14 0 6 1/5 0 -3/5 1
zj – cj 0 -2 4/5 0 3/5 0
31
Continued…
Table 3
cj 3 2 1 0 0 0
cB xB b x1 x2 x3 s1 s2 s3
0 s1 17/3 0 0 16/15 1 -1/5 -2/3
3 x1 9 1 0 3/5 0 1/5 0
2 x2 7/3 0 1 1/30 0 -1/10 1/6
zj – cj 0 0 13/15 0 2/5 1/3
Optimum solution: x1 =9; x2 = 7/3, x3 = 0, max Z = 95/3 32
Example (C.W.)
Min Z = x1 + x2
Subject to
5x1 + 9x2 45
x1 + x2 2
x2 4
x1 , x2 0
33
Example
Max Z = 107x1 + x2 + 2x3
subject to
14x1 + x2 - 6x3 +3x4 =7
16x1 + x2/2 - 6x3 5
3x1 - x2 - x3 0
x1 , x2, x3 , x4 0
34
Continued…
Max Z = 107x1 + x2 + 2x3 + 0.x4 +0.s1
+0.s2
subject to
14x1/3+ x2/3 - 2x3 + x4 = 7/3
16x1 + x2/2 - 6x3 + s1 = 5
3x1 - x2 - x3 + s2 = 0
x1 , x2, x3 , x4 , s1, s2 0
35
Continued…
Table 1
cj 107 1 2 0 0 0
cB xB b x1 x2 x3 x4 s1 s2
0 x4 7/3 14/3 1/3 -2 1 0 0
0 s1 5 16 1/2 -6 0 1 0
0 s2 0 3 -1 -1 0 0 1
zj – cj -107 -1 -2 0 0 0
36
Continued…
Table 2
cj 107 1 2 0 0 0
cB xB b x1 x2 x3 x4 s1 s2
0 x4 7/3 0 17/9 -4/9 1 0 -114/9
0 s1 5 0 35/6 -2/3 0 1 -16/3
107 x1 0 1 -1/3 -1/3 0 0 1/3 Unbounded
solution.
zj – cj 0 -101/3 -113/3 0 0 -107/3
37
Additional Problems
Max Z = 5x1 + 3x2 Max Z = x1 - x2 + 3x3
s. t. 3x1 + 5x2 15 s. t. x1 + x2 + x3 10
5x1 + 2x2 10 x1 - x 3 2
x1 , x2 0 2x1 -2x2 + 3x3 0
x1 , x2 , x3 0
( x1 = 20/19, x2 = 45/19 ( x1 = 0, x2 = 6, x3 = 4
Objective value = 235/19) Objective value = 6)
Max Z = 4x1 + x2 + 3x3 + 5x4 Min Z = x1 - 3x2 + 2x3
s. t. 4x1 - 6x2 - 5x3 - 4x4 -20 s. t. 3x1 - x2 + 2x3 7
3x1 - 2x2 - 4x3 + x4 10 -2x1 + 4x2 12
8x1 - 3x2 + 3x3 + 2x4 20 -4x1 + 3x2 + 8x3 10
x1 , x2 , x3, x4 0 x1 , x2 , x3 0
( x1 = 4, x2 = 5, x3 = 0
(Unbounded solution) Objective value = -11)
38
Big M-Method of A. Charnes
Example
Max Z = 2x1 + 3x2
subject to
x1 + x2 8
x1 + 2x2 =5
2x1 + x2 8
x1 , x2 0
40
Continued…
Max Z = 2x1 + 3x2 + 0.s1 - M.s2 + 0.s3
subject to
x1 + x2 + 1.s1 + 0.s2 + 0.s3 =8
x1 + 2x2 + 0.s1 + 1.s2 + 0.s3 =5
2x1 + x2 + 0.s1 + 0.s2 + 1.s3 =8
x1, x2, s1, s2, s3 0
41
Continued…
Table 1
cj 2 3 0 -M 0
cB xB b x1 x2 s1 s2 s3
0 s1 8 1 1 1 0 0
-M s2 5 1 2 0 1 0
0 s3 8 2 1 0 0 1
zj – cj -M-2 -2M-3 0 0 0
42
Continued…
Table 2
cj 2 3 0 -M 0
cB xB b x1 x2 s1 s2 s3
0 s1 11/2 1/2 0 1 … 0
3 x2 5/2 1/2 1 0 … 0
0 s3 11/2 3/2 0 0 … 1
zj – cj -1/2 0 0 … 0
43
Continued…
Table 3
cj 2 3 0 -M 0
cB xB b x1 x2 s1 s2 s3
0 s1 11/3 0 0 1 … -1/3
3 x2 2/3 0 1 0 … -1/3
2 x1 11/3 1 0 0 … 2/3
zj – cj 0 0 0 … 1/3
Optimum solution: x1 = 11/3, x2 = 2/3, max Z = 28/3
44
Example
Min Z = 4x1 + 3x2
subject to
2x1 + x2 10
-3x1 + 2x2 6
x1 + x2 6
x1 , x2 0
45
Continued…
Max Z* = -4x1 - 3x2 + 0.s1 + 0.s2 + 0.s3
subject to
2x1 + x2 - 1.s1 = 10
-3x1 + 2x2 + 1.s2 =6
x1 + x2 -1.s3 = 6
x1, x2, s1, s2, s3 0
46
Continued…
Max Z* = - 4x1 - 3x2 + 0.s1 + 0.s2 + 0.s3 - M.s4 - M.s5
subject to
2x1 + x2 - 1.s1 + 0.s2 + 0.s3 + 1.s4 + 0.s5 = 10
-3x1 + 2x2 + 0.s1 + 1.s2 + 0.s3 + 0.s4 + 0.s5 =6
x1 + x2 + 0.s1 + 0.s2 - 1.s3 + 0.s4 + 1.s5 = 6
x1, x2, s1, s2, s3, s4, s5 0
47
Continued…
Table 1
cj -4 -3 0 0 0 -M -M
cB xB b x1 x2 s1 s2 s3 s4 s5
-M s4 10 2 1 -1 0 0 1 0
0 S2 6 -3 2 0 1 0 0 0
-M s5 6 1 1 0 0 -1 0 1
zj – cj -3M+4 -2M+3 M 0 M 0 0
48
Continued…
Table 2
cj -4 -3 0 0 0 -M -M
cB xB b x1 x2 s1 s2 s3 s4 s5
-4 x1 5 1 1/2 -1/2 0 0 -- 0
0 S2 21 0 7/2 -3/2 1 0 -- 0
-M s5 0 0 1/2 1/2 0 -1 -- 1
-M/2 -M/2
zj – cj 0 0 M -- 0
+1 +2 49
Continued…
Table 3
cj -4 -3 0 0 0 -M -M
cB xB b x1 x2 s1 s2 s3 s4 s5
-4 x1 4 1 0 -1 0 1 -- --
0 S2 14 0 0 -5 1 7 -- --
-3 x2 2 0 1 1 0 2 -- --
zj – cj 0 0 1 0 2 -- --
Optimum solution: x1 = 4, x2 = 2, min Z = 22
50
Example
Max Z = 3x1 + 2x2
subject to
2x1 + x2 2
3x1 + 4x2 12
x1 , x2 0
51
Continued…
Table 1
cj 3 2 0 0 -M
cB xB b x1 x2 s1 s2 s5
0 s1 2 2 1 1 0 0
-M s3 12 3 4 0 -1 1
zj – cj -3M-3 -4M-2 0 M 0
52
Continued…
Table 2
cj 3 2 0 0 -M
cB xB b x1 x2 s1 s2 s5
2 x2 2 2 1 1 0 0
-M s3 4 -5 0 -4 -1 1
zj – cj 5M+1 0 4M+2 M 0
All zj – cj 0 and an artificial variable s3 appears in the basis.
So, the LPP does not possess any feasible solution.
53
Additional Problems
Min Z = 12x1 + 20x2 Max Z = 5x1 - 2x2 + 3x3
s. t. 6x1 + 8x2 100 s. t. 2x1 + 2x2 - x3 2
7x1 + 12x2 120 3x1 - 4x2 3
x1 , x2 0 x2 + 3x3 5
x1 , x2 , x3 0
( x1 = 15, x2 = 5/4 ( x1 = 23/3, x2 = 5, x3 = 0
Objective value = 205) Objective value = 85/3)
Min Z = x1 + x2 + x3 Min Z = 2x1 + x2
s. t. x1 - x2 + 2x3 =2 s. t. 3x1 + x2 =3
-x1 + 2x2 - x3 =1 4x1 + 3x2 6
x1 , x2 , x3 0 x1 + 2x2 3
( x1 = 0, x2 = 4/3, x3 = 5/3 x1 , x2 0
Objective value = 3) ( x1 = 3/5, x2 = 6/5
Objective value = 12/5)
54
Continued…
Max Z = x1 - x2 + 2x3 Min Z = x1 - 2x2 - 3x3
s. t. -x1 + x2 + 2x3 5 s. t. -2x1 + x2 + 3x3 =2
-2x1 + 5x2 - x3 10 2x1 + 3x2 + 4x3 =1
2x1 - x2 + x3 4 x1 , x2 , x3 0
x1 , x2 , x3 0
( No feasible solution)
( Unbounded solution)
55
Case Study
Bus Scheduling
A city is studying the feasibility of introducing a mass-
transit bus system that alleviate the smog problem by
reducing in-city driving. The study seeks the minimum
number of buses that cab handle the transportation
needs. After gathering necessary information, the city
engineer noticed that the minimum number of buses
needed fluctuated with the time of the day and that the
required number of buses could be approximated by
constant values over successive 4-hour intervals. The
summary of the engineer’s finding is shown in the next
slide. To carry out the required daily maintenance,
each bus can operate 8 successive hours a day only.
Portfolio Selection
Stock fund portfolio selection is an important and
challenging problem. Using linear programming,
construct an efficient stock portfolio for an investor for
the following problem:
Objective: Maximize annual return on investment
Constraints:
Portfolio’s price earnings ratio
Investment
Investment diversification