LPP Solution Using Simplex Method
LPP Solution Using Simplex Method
LPP Solution Using Simplex Method
1
Simplex Method
1. Linear programming can handle problems involving only two decision variables.
2. Simplex method provides an efficient technique which can be applied for solving
LPPs of any magnitude - involving two or more decision variables
3. In this technique the objective function is used to control the development of each
feasible solution to the problem.
4. If an optimal solution to the problem exists, it is located at the corner points of the
feasible region determined by the constraints of the system.
5. Simplex method selects optimal solution from among the set of feasible solutions to
the problem by iterative search.
Ø There are two conditions to be satisfied in order to apply simplex method to a linear
programming problem.
1. The R.H.S of each of the constraints bi should be non –negative.
• If an LLP has a constraint for which a negative resource value is given, it should be,
in first step, converted to positive value.
After the solution is obtained, we shall substitute the difference of the values of X4, and
X5 in place of X3
Example 1- Solve the following LP problem using Simplex method
Maximize, Z = 12X1 + 16X2
Subject to
10X1 + 20X2 £ 120
8X1 + 8X2 £ 80
X1 ³ 0, X1 ³ 0
Z = 12X1 + 16X2
10X1 + 20X2 + S1 = 120
8X1 + 8X2 + S2 = 80
Z = 12X1 + 16X2 + 0S1 + 0S2
X1, X2, S1, S2 ³ 0
Note : S1 and S2 are called Slack variables, it can take any slack between the left and right
hand side inequalities upon converting into equal)
Initial Simplex tableau
Basic variables
Zj
Cj - Zj
Basic variables
X1 X2 S1 S2
0 S1 10 20 1 0 120
0 S2 8 8 0 1 80
Zj
Cj - Zj
Basic variables
X1 X2 S1 S2
(BV)
0 S1 10 20 1 0 120
0 S2 8 8 0 1 80
Zj 0 0 0 0 0
Cj - Zj 12 16 0 0
Since Cj – Zj are 12 and 16 respectively which are more than zero and positive
Solution is not optimal
Next select the maximum value of Cj – Zj, i.e 16 (this is called key column)
Then calculate the ratio i.e 120/20 = 6 (dividing the solution by bi value of this column)
similarly 80/8 =10
In order to find the key row, select the column of least ratio, i.e 6
Cbi Cj 12 16 0 0 Solution Ratio
Basic variables X1 X2 S1 S1
(BV)
0 S1 10 1 0 120
120
10
20 120/20 = 6
0
0 S2 8 8 0 1 80 80/8 = 10
Zj
0 0 0 0 0
Cj - Zj 0 0
12 16
Next select the maximum value of Cj – Zj, i.e 16 (this column is called key column)
Then calculate the ratio i.e 120/20 = 6
similarly 80/8 =10
In order to find the key row, select the column of least ratio, i.e 6
entering variable Key element
Basic variables X1 X2 S1 S1
(BV)
0 S1 10 1 0 120
120
10
20 120/20 = 6
0
0 S2 8 8 0 1 80 80/8 = 10
Zj
0 0 0 0 0
Cj - Zj 0 0
12 16
Key column
leaving variable Key row
Entering variable
1St Iteration process
Basic variables X1 X2 S1 S2
(BV)
S1
0 leaving variable
S2
0
Zj
Cj - Zj
Basic variables X1 X2 S1 S2
(BV)
S2
0
Zj
Cj - Zj
for the first row, divide the old coefficients of basic vales of variables with the key element
1St Iteration process
Basic variables X1 X2 S1 S2
(BV)
X2 1/20 1 1/20 0 6
16
S2
0
Zj
Cj - Zj
for the first row, divide the old coefficients of basic vales of variables with the key element
For the values of the second row use the following formula
Cbi Cj 12 16 0 0 Solution Ratio
Basic variables X1 X2 S1 S1
(BV)
0 S1 10 1 0 120
120
10
20 120/20 = 6
0
0 S2 8 8 0 1 80 80/8 = 10
Zj
0 0 0 0 0
Cj - Zj 0 0
12 16
1St Iteration
Basic variables
X1 X2 S1 S2
16 X2 1/2 1 1/20 0 6
0 S2 4 0 - 2/5 1 32
Zj
Cj - Zj
Find Zj Value
(16 x 1/2) + (0 x 4) = 8
(16 x 1) + (0 x 0) = 16
(16 x 0) + (0 x 1) = 0
(16 x 6) + (0 x 32) = 96
Next select the maximum value of Cj – Zj, i.e 4 (this is called key column)
Cbi Cj 12 16 0 0 Solution Ratio
Basic variables X1 X2 S1 S2
16 X2 1/2 1 1/20 0 6
0 S2 4 0 - 2/5 1 32
Zj 8 16 4/5 0 96
Cj - Zj 4 0 - 4/5 0
Since Cj – Zj are 4,0. – 4/5 and 0, respectively, 4 is more than zero and positive.
Therefore, Solution is not optimal
For all maximization problems Cj – Zj should be £ 0
Next select the maximum value of Cj – Zj, i.e 4 (this is called key column)
2nd Iteration
Basic variables X1 X2 S1 S2
16 X2 1/2 1 1/20 0 6 12
1/2
0 S2 44 0 - 2/5 1 32 8
Zj 8 16 4/5 0
Cj - Zj 4 0 - 4/5 0
In order to find the key row, select the column of least ratio, i.e 8
2nd Iteration entering variable
Basic variables
X1 X2 S1 S2
(BV)
0 S2 44 00 - 2/5
- 2/5 11 32
32/4 8
32
Zj 8 16 4/5 0
Cj - Zj 4 0 - 4/5 0
leaving variable
Cbi Cj 12 16 0 0 Solution Ratio
Basic variables X1 X2 S1 S2
16 X2
Zj
Cj - Zj
in order to find new variables, divide the row with key element 4
CBj Cj 12 16 0 0 Solution Ratio
Basic variables
X1 X2 S1 S2
(BV)
16 X2
12 X1 1 0 - 1/10 1/4 8
Zj
Cj - Zj
CBj Cj 12 16 0 0 Solution Ratio
Basic variables
X1 X2 S1 S2
(BV)
16 X2 0 1 1/10 - 1/8 2
12 X1 1 0 - 1/10 1/4 8
Zj
Cj - Zj
Find Zj Value
(16 x 0) + (12 x ) = 12
(16 x 1) + (12 x 0) = 16
Basic variables X1 X2 S1 S2
(BV)
16 X2 0 1 1/10 - 1/8 2
12 X1 1 0 - 1/10 1/4 8
Zj 12 16 2/5 1 128
Cj - Zj 0 0 - 2/5 -1
X1 = 2, X2 = 8, Z = 128
Optimal solution is
X1 = 12
X2 = 16
Z = 128
Example 2
A manufacturer of wooden articles produces tables and chair which require two types of
inputs, i.e. wood and labor,
Each table requires 2 units of wood and 4 unit labor
Each chair requires 3 units of wood and 3 units of labor
Profit from each table is Rs 40 and profit from each chair is Rs 35
Total available resources for manufacturing tables and chair are 60 units of wood and 96
units of labor.
The manufacturer wants to maximize his profit by distributing his resources for each table
and chair.
Formulate the problem mathematically and solve using simplex method
Example – 2, Interpretation of the vales in the problem and solution
Let the tables be X1 and chairs be X2
subject to raw material constraint 2X1 + 3X2 £ 60 Total wood available is 60 units
2 units of wood is required per table 3 units of wood is required per table
X1, X2 ≥ 0
Labour hour constraint 4X1 + 3X2 £ 96 Total labour available is 96 hours
X1 table and X2 chairs are
4 units of labour is required per table 3 units of labour is required per table not negative
Interpretation of elements in Simplex tableau
Let S1 be slack variable for wood and S2 be slack variable for labour hours
40 35 4X1 + 3X 0 2 + S02 = 96
Hrs of labour @ 0 Rs. per hour
Ø We are adding S1 and S2 objective function because, if wood or labour is left over, that
will be added to our objective of profit.
Ø Let us start with the assumption that, Zero cost for slack material and slack labour
Ø At the end of the solution if S1 or S2 leftover if any, so many units will be considered as
left over units of inputs.
Initial Simplex tableau
Zj
Cj - Zj
Ø Zj represents the loss of profit that results from the addition of one unit of variable heading a particular
column. (wood and labour for table and wood and labour for chair)
Basic variables X1 X2 S1 S2
0 S1
0 S2
Zj
Cj - Zj
Interpretation of elements in Simplex tableau
2X1 + 3X2 + S1 = 60
Z = 40X1+35X2+0S1+0S2 4X1 + 3X2 + S2 = 96
Cbi Cj 40 35 0 0 Solution Ratio
Basic variables
X1 X2 S1 S2
0 S1 2 3 1 0 60
0 S2 4 3 0 1 96
Zj 0 0 0 0 0
Cj - Zj 40 35 0 0
Basic variables X1 X2 S1 S2
(BV)
0 S1 2 3 1 0 60
2 60 /2= 30
S2 44 3 0 1 96
0 96/4 =24
96
3
1
Zj
0 0 0 0 0
Cj - Zj
40 35 0 0
We have more profit from table, we can use all the resources for making tables only. Therefore select table as
a product to work (i.e key column)
How many tables and chairs can be made from available wood and labour ?
we need 2 units of wood /table we have 60 units of wood i.e we can make 60/2 – 30 tables
Cbi Cj 40 35 0 0 Solution Ratio
Basic variables X1 X2 S1 S2
(BV)
0 S1 2 3 1 0 60 60 /2= 30
2
96
3
1
Zj 0 0 0 0 0
Cj - Zj 40 35 0 0
we need 4 hrs of labour /table we have 96 units of labour i.e we can make 96/4 –24 tables
Though we have wood for 30 tables we can only make 24 tables because of labour constraint
therefore select the least value 24 (S2 or labour) to calculate the best product mix (select S2 labour as key row)
entering variable
Cbi Cj 40 35 0 0 Solution Ratio
Basic variables X1 X2 S1 S2
(BV)
0 S1 4 3 1 0 60 60 /2= 30
2
96
40
1
Zj 0 0 0 0 0
leaving variable
Cj - Zj 40 35 0 0
We have selected to work on table consuming all the labour hours by making slack S2 = 0
therefore we can replace S2 with X1
Cbi Cj 40 35 0 0 Solution Ratio
Basic variables X1 X2 S1 S2
(BV)
0 S1 2 3 1 0 60
2
40 X1 44 3 0 1 96 96/4 =24
96
3
1
Zj
0 0 0 0 0
Cj - Zj 0 0
40 35
Divide the key row coefficients with key element (in this case time required per table)
(4/4), (3/4), (0/4), (1/4) and (96/4) (we are dividing the time required per table across the
products, to see if one hour time is left how many other products can be made))
Cbi Cj 40 35 0 0 Solution Ratio
Basic variables X1 X2 S1 S2
(BV)
0 S1 4 3 1 0 60 60 /2= 30
2
96/4
3/4
0/4
1/4
Zj
Cj - Zj
3 - 2x3 /4 = 3/2
For the second row apply the formula ; old value – {(corresponding key column value) x (corresponding key
row value)} / key element
X1 = 2 - 2 X4/4 =0
X2 = 3 - 2x3 /4 = 3/2
S1 = 1- 2 x 0 /4 = 1
S2 = 0 - 2x1/4 = -1/2
solution = 60 – 2 x96/4 = 12
Zj
X1 = (0x0)+(40x1) = 40 ; X2 = (0 x3/2)+(40x3/4) = 30
Basic variables X1 X2 S1 S2
(BV)
Zj
Cj - Zj
Cbi Cj 40 35 0 0 Solution Ratio
Basic variables X1 X2 S1 S2
(BV)
Cj - Zj
Ø Substitution rates or changes in S2 : Since one unit of X1 requires four hours, solution in
the tableau uses up all the 96 hrs.
Ø If one unit of S2 i.e one hour is made available for other purposes, then ¼ units of X1
would have to be given up.
Ø Since one unit of X1 require 2 kgs of wood, one hour of S2 reduces the out put of X1 by ¼
units , ¼ x 2 = ½ of wood would be unutilised (-1/2)
Solution I
Cbi Cj 40 35 0 0 Solution Ratio
Basic variables X1 X2 S1 S2
(BV)
Zj 960
40 30 0 10
Cj - Zj 0 5 0 -10
Ø Adding a unit of X2 would replace 3/2 kgs of wood ( 2 x ¾ = 3/2) or released from X1
Cbi Cj 40 35 0 0 Solution Ratio
Basic variables X1 X2 S1 S2
(BV)
Ø Substitution rates or changes in X1 : Addition of one unit of X1 would replace, one unit of
the same product.
Ø Addition of X1 and replacing by X1 imply no change in the requirement of wood, it is
zero.
0 S1 0 3/2
3/2 1 -1/2 12 12/3/2= 8
40 X1 1 3/4
3/4 0 1/4 24 24/3/4 =32
Zj 960
40 30 0 10
Cj - Zj 0 5 0 -10
Cbi Cj 40 35 0 0 Solution Ratio
Basic variables X1 X2 S1 S2
(BV)
0 S1 0 3/23/2 1 -1/2 12
-1/2
3/2
12/3/2 = 8
12
0
1
40 X1 1 3/4
3/4 0 1/4 24
24x4/3=32
Zj 960
40 30 0 10
Cj - Zj 0 5
0 -10
Negative signs are gains and positive signs are loss or giving up for other activities
Cbi Cj 40 35 0 0 Solution Ratio
Basic variables X1 X2 S1 S2
(BV)
35 X2 0 1 2/3 -1/3 8
12/3/2 = 8
40 X1 1 0 -1/2 1/2 18 24x4/3=32
Zj 40 35 10/3 25/3 1000
Cj - Zj 0 0
-10/3 -25/3
Ø The values 0 and 1 under X1 suggest that a unit of X1 added to the current mix will call for replacing one
unit of the same product in the solution with 0 change needed in the other product.
Ø Similarly for X2 adding one product of X2 will have no change in X1
Ø For S1 2/3 for X2 and -1/2 for X1 implies that, releasing (removing) one kg of wood would mean losing
2/3 units of X2 and gaining ½ units of X1
Ø Loss of 2/3 units of X2 and gain of ½ units of X1 would result in net loss of (35 x 2/3) – (40 x ½) = - 10/3
Cbi Cj 40 35 0 0 Solution Ratio
Basic variables X1 X2 S1 S2
(BV)
35 X2 0 1 2/3 -1/3 8
40 X1 1 0 -1/2 1/2 18
Cj - Zj 0 0
-10/3 -25/3
Ø For S2 the values - 1/3 for X2 and 1/2 for X1 indicate that, releasing (removing) one hour of labour would
mean losing ½ units of X1 and gaining 1/3 hours X2
Ø reduction of ½ hours from X1 would release 4 x ½ = 2 hours of labour while adding 1/3 hrs for X2 that
would consume 3 x 1/3 = 1 hour of labour