Linear Programming: Simplex Method: Dr. R. K Singh Professor, Operations Management MDI, Gurgaon
Linear Programming: Simplex Method: Dr. R. K Singh Professor, Operations Management MDI, Gurgaon
By
Dr. R. K Singh
Professor, Operations Management
MDI, Gurgaon
1-1
Simplex Method
For LP problems with several variables, optimal solution will still lie at an
extreme point of the many-sided, multidimensional figure that represents
the feasible solution space.
1-2
Standard Form of An LP Problem
1-3
Standard form of the LP problem is expressed as:
1-4
Three types of additional variables, namely
slack variables (s)
surplus variables ( s), and
artificial variables (A)
are added in the given LP problem to convert it into the standard form
for the following reasons:
(a) These variables allow us to convert inequalities into equalities,
thereby converting the given LP problem into a form that is
amenable to algebraic solution.
1-5
Types of Constraint Extra Variable Coefficient of Extra Variables
Needed in the Objective Function
Max Z Min Z
1-6
Simplex Algorithm (Maximization Case)
Minimize Z = Maximize Z*
where Z* = Z.
1-7
d) Express the mathematical model of the given LP problem in the
standard form by adding additional variables to the left side of
each constraint and assign a zero-cost coefficient to these in the
objective function.
1-8
Initial Simplex Table A
Cj c1 c2 cn 0 0 0
Coefficient of Variables Value of Basic Variables
Basic Variables in Basis Variables x1 x2 xn s1 s2 . . . sm
(cB) B b (= xB)
cB1 s1 xB1 = b1 a 11 a12 a1n 1 0 0
1-9
The Simplex Method
The values zj represent the amount by which the value of objective function
Z would be decreased (or increased) if one unit of given variable is added
to the new solution. Each of the values in the cj zj row represents the net
amount of increase (or decrease) in the objective function that would occur
when one unit of variable represented by the column head is introduced
into the solution. That is:
1-10
Step 3: Test for optimality
If at least one column of the coefficients matrix (i.e. ak ) for which ck zk >
0 and all elements are negative (i.e. aik < 0), then there exists an
unbounded solution to the given problem.
If at least one cj zj > 0 and each of these has at least one positive
element (i.e. aij ) for some row, then it indicates that an improvement in
the value of objective function Z is possible.
1-11
Step 4: Select the variable to enter the basis
If Case (iii) of Step 3 holds, then select a variable that has the largest
cj zj value to enter into the new solution. That is,
1-12
Step 5: Test for feasibility (variable to leave the basis)
Each number in xB-column (i.e. bi values) is divided by the corresponding
(but positive) number in the key column and a row is selected for which this
ratio, [(constant column)/(key column)] is non-negative and minimum. This
ratio is called the replacement (exchange) ratio. That is,
xBr xBi
arj
= Min ; arj > 0
arj
This ratio limits the number of units of incoming variable that can be
obtained from the exchange. It may be noted here that division by negative
or zero element in key column is not permitted.
1-13
Step 6: Finding the new solution
If the key element is 1, then the row remains the same in the new simplex
table.
If the key element is other than 1, then divide each element in the key
row (including elements in xB-column ) by the key element, to find the
new values for that row.
The new values of the elements in the remaining rows for the new
simplex table can be obtained by performing elementary row operations
on all rows so that all elements except the key element in the key column
are zero.
In other words, for each row other than the key row, we use the formula:
Number in
=
Number in
+ Number above or below Corresponding number in the new row,
new row old row Key element that is row replaced in Step 6 (ii)
1-14
Step 7: Repeat the procedure
Go to Step 3 and repeat the procedure until all entries in the cj zj row
are either negative or zero.
1-15
Example 1: Use the simplex method to solve the following LP problem.
Maximize Z = 3x1 + 5x2 + 4x3
2x1 + 3x2 8
2x2 + 5x3
3x1 + 2x2 + 4x3
and x1, x2, x3 >
1-16
. . . The Simplex Method
Solution Step 1: Introducing non-negative slack variables s1, s2 and s3
to convert inequality constraints to equality. Then the LP problem
becomes
2x1 + 3x2 + s1 = 8
2x2 + 5x3 + s2 = 10
3x1 + 2x2 + 4x3 + s3 = 15
and x1, x2, x3, s1, s2, s3 0
1-17
Step 2: Since all bi (RHS values) > 0, (i = 1, 2, 3) we can choose initial
basic feasible solution as:
x1 = x2 = x3 = 0; s1 = 8, s2 = 10, s3 = 15 and Max Z = 0
This solution can also be read from the initial simplex Table by equating
row wise values in the basis (B) column and solution values (xB ) column.
1-18
Step 3: To see whether the current solution given in Table is optimal or
not, calculate
cj zj
These zj values are now subtracted from cj values to calculate net profit from
introducing one unit of each variable x1, x2 and x3 into the new solution mix.
c1 z1 = 3 0 = 3
c2 z2 = 5 0 = 5
c3 z3 = 4 0 = 4
1-19
The zj and cj zj rows are added into the Initial Solution Table.
The values of basic variables, s1, s2 and s3 are given in the solution values
(xB ) column of Table. The remaining variables which are non-basic at the
current solution have zero value. The value of objective function at the
current solution is given by
1-20
Initial Solution Table 1
cj 3 5 4 0 0 0
Solution Min
Profit Variables in
Exchange
per Unit Basis Values x1 x2 x3 s1 s2 s3
Ratio
cb B B (= xb)
xB/x2
0 s1 8 2 0 1 0 0 8/3
0 s2 10 0 2 5 0 1 0 10/2
0 s3 15 3 2 4 0 0 1 15/2
Z=0 zj 0 0 0 0 0 0
cj - zj 3 5 4 0 0 0
1-21
Since all cj zj > 0 ( j = 1, 2, 3), the current solution is not optimal.
Variable x2 is chosen to enter into the basis as c2 z2 = 5 is the largest
positive number in the x2-column, where all elements are positive. This
means that for every unit of variable x2, the objective function will
increase in value by 5.The x2-column is the key column.
1-22
. . . The Simplex Method
Step 5: (Iteration 1) Since the key element enclosed in the circle in Table
1 is not 1, divide all elements of the key row by 3 to obtain new values of
the elements in this row. The new values of the elements in the remaining
rows for the new Table 2 are obtained by performing the following
elementary row operations on all rows so that all elements except the key
element 1 in the key column are zero.
1-23
. . . Step 5: (Iteration 1)
1-24
Improved Solution Table 2
cj 3 5 4 0 0 0
cj zj - 1/3 0 4 - 5/3 0 0
1-25
. . . The Simplex Method
An improved basic feasible solution can be read from Improved Solution
Table as: x2 = 8/3, s2 = 14/3, s3 = 29/3 and x1 = x3 = s1 = 0. The improved
value of the objective function is
1-26
Step 6: (Iteration 2 ) Repeat Steps 3 to 5. Table 3 is obtained by
performing following row operations to enter variable x3 into the basis
and to drive out s2 from the basis.
1-27
Improved Solution Table is completed by calculating the new zj and cj zj
values and the new value of objective function:
1-28
Improved Solution Table 3
cj 3 5 4 0 0 0
Profit Variables Solution x1 x2 x3 s1 s2 s3 Min Ratio
per in Basis Values xB/ x1
Unit B b (= xB)
CB
1-29
Iteration 3 In Improved Solution Table since, c1 z1 is still a positive value, the
current solution is not optimal. Thus, the variable x1 enters the basis and s3
leaves the basis. To get another improved solution as shown in Table 4
performing following row operations in the same manner as discussed earlier.
1-30
R1 (new) R1 (old) (2/3) R3 (new) R2 (new) R2 (old) + (4/15) R3 (new)
1-31
Optimal Solution Table 4
cj 3 5 4 0 0 0
Profit Variables Solution x1 x2 x3 s1 s2 s3
per Unit in Basis Values
CB B b (= xB)
5 x2 50/41 0 1 0 15/41 8/41 - 10/41
4 x3 62/41 0 0 1 - 6/41 5/41 4/41
3 x1 89/41 1 0 0 - 2/41 - 12/41 15/41
Z = 765/41 zj 3 5 4 45/41 24/41 11/41
cj zj 0 0 0 - 45/41 - 24/41 - 11/41
In Optimal Solution Table all cj zj < 0 for non-basic variables. Therefore, the
optimal solution is reached with, x1 = 89/41, x2 = 50/41, x3 = 62/41 and the
optimal value of Z = 765/41.
1-32
Simplex Algorithm (Minimization Case)
, xj 0
but some right-hand side constants are negative [i.e. bi < 0]. In this
case after adding the non-negative slack variable si (i = 1, 2, . . ., m),
the initial solution so obtained will be si = bi for some i. It is not the
feasible solution because it violates the non-negativity conditions of
slack variables (i.e. si 0).
1-33
. . . Simplex Algorithm (Minimization Case)
, xj 0
1-34
. . . Simplex Algorithm (Minimization Case)
xj, si, Ai 0, i = 1, 2, . . ., m
1-35
The Big-M Method
1-36
Steps of the algorithm
Step 1: Express the LP problem in the standard form by adding slack
variables, surplus variables and artificial variables. Assign a zero
coefficient to both slack and surplus variables and a very large positive
coefficient + M (minimization case) and M (maximization case) to artificial
variable in the objective function.
1-37
. . . Steps of the algorithm
Step 3: Calculate the values of cj zj in last row of the simplex table and
examine these values.
1-39
. . . Steps of the algorithm
At any iteration of the simplex algorithm any one of the following cases
may arise:
1-40
Example: Use the penalty (Big-M) method to solve the following LP problem.
Minimize Z = 5x1 + 3x2
subject to the constraints
2x1 + 4x2 12
2x1 + 2x2 = 10
5x1 + 2x2 10
and x1, x2 0.
1-42
Initial solution Table 5
cj 5 3 0 0 M M
Cost Variables Solution x1 x2 s1 s2 A A2 Min Ratio
per in Basis Values 1 xB/ x1
Unit B b (= xB)
CB
0 s1 12 2 4 1 0 0 0 12/2 = 6
M A1 10 2 2 0 0 1 0 10/2 = 6
M A2 10 2 0 -1 0 1 10/5 = 2
Z = 20M zj 7M 4M 0 -M M M
cj - zj 5 7M 3 4M 0 M 0 0
1-43
. . . The Big-M Method
Iteration 1: Introduce variable x1 into the basis and remove A2 from the
basis by applying the following row operations. The new solution is shown
in Improved Solution Table 6.
R3 (new) R3 (old) 5 (key element); R2 (new) R2 (old)
2R3 (new).
R1 (new) R1 (old) 2R3 (new).
1-44
Improved Solution Table 6
cj 5 3 0 0 M
Cost Variables Solution x1 x2 s1 s2 A1 Min Ratio
per in Basis Values xB/ x2
Unit B b (= xB)
CB
0 s1 8 0 16/5 1 2/5 0 8/(16/5) = 5/2
M A1 6 0 6/5 0 2/5 1 6/(6/5) = 5
5 x1 2 1 2/5 0 - 1/5 0 2/(2/5) = 5
Z = 10 + 6M zj 5 (6M/5) + 2 0 (2M/5) 1 M
cj - zj 0 (- 6M/5) + 1 0 (- 2M/5) + 0
1
1-45
. . . The Big-M Method
1-46
Improved Solution Table 7
cj 5 3 0 0 M
Cost Variables Solution x1 x2 s1 s2 A1 Min Ratio
per in Basis Values xB/ s2
Unit B b (= xB)
CB
3 x2 5/2 0 1 5/16 1/8 0 (5/2)/(1/8) = 40
M A1 3 0 0 - 3/8 1/4 1 3/(1/4) = 12
5 x1 1 1 0 - 1/8 - 1/4 0 -
1-47
. . . The Big-M Method
1-48
Optimal Solution Table 8
cj 5 3 0 0
Cost Variables Solution x1 x2 s1 s2
per Unit in Basis Values
CB B b (= xB)
3 x2 1 0 1 1/2 0
0 s2 12 0 0 - 3/2 1
5 x1 4 1 0 - 1/2 0
Z = 23 zj 5 3 -1 0
cj - zj 0 0 1 0
1-49
. . . The Big-M Method
1-50
. . . The Big-M Method
1-51
Initial Solution Table 9
cj 1 2 3 -1 -M -M
Profit Variables Solution x1 x2 x3 x4 A1 A2 Min Ratio
per in Basis Values xB/ x3
Unit B b (= xB)
CB
-M A1 15 1 2 3 0 1 0 15/3 = 5
-M A2 20 2 1 0 0 1 20/5 = 4
-1 x4 10 1 2 1 1 0 0 10/1 = 10
Z = - 35M 10 zj - 3M - 1 - 3M - 2 - 8M - 1 -1 -M -M
cj - zj 3M + 2 3M + 4 8M + 4 0 0 0
1-52
. . . The Big-M Method
1-53
Improved Solution Table 10
cj 1 2 3 1 M
M A1 3 1/51 7/5 0 0 1 3 = 15
7/5 7
3 x3 4 2/5 1/5 1 0 0 4 = 20
15
/
1 x4 6 3/5 9/5 0 1 0 6 = 30
9/5 9
Z = 3M + 6 zj M/5 + 3/5 7M/5 6/5 3 1 M
1-55
Improved Solution Table 11
cj 1 2 3 1
Profit Variables Solution x1 x2 x3 x4 Min Ratio
per Unit in Basis Values xB/ x1
CB B b (= xB)
2 x2 15/7 1/7 1 0 0 __
Z = 90/7 zj 1/7 2 3 1
cj zj 6/7 0 0 0
1-56
. . . The Big-M Method
1-57
Optimal Solution Table 12
cj 1 2 3 1
Profit Variables Solution x1 x2 x3 x4
per Unit in Basis Values
CB B b (= xB)
2 x2 15/6 0 1 0 1/6
3 x3 15/6 0 0 1 3/6
1 x1 15/6 1 0 0 7/6
Z = 15 zj 1 2 3 0
cj zj 0 0 0 1