Linear Programming
Linear Programming
Introduction
At the same time they have observed that this cost or profit is the linear
function of variables. The programming refers to the process of
determining a particular programme or plan of action.
Definition
Basically there are two different methods to solve the linear programming
problems namely graphical method and Simplex method.
If the number of variables are two one can solve the problem by either
graphical method or simplex method.
If the number of variables is more than two, one must use the simplex
method to solve the LPP.
In that case (No of variables > 2) we cannot represent all those variables on
a graph, so one must use simplex method.
PROPERTIES OF LINEAR PROGRAMMING MODEL
It is assumed that only one decision is required for the planning period.
Solution
From the description of the problem one can understand that the objective is
to maximize the profit.
So one has to find out how many number of product A and product B items
to be produced to get the maximum profit.
As we don’t know the number of items of product A and Product B to be
produced, let us assume
Now the profit on one item of type A is Rs 2 and the number of items of type
A are x.
Similarly the profit on one item of type B is Rs 3 and the number of items of
type A are y.
Now the total profit on both Product A and B is = 2x + 3y, and it should be
maximized and let the total profit is Z
Maximize Z = 2x + 3y
Now with increase in the values of x and y the value of z or profit will goes
on increase
But there are the restrictions on the production time of machines G and H.
Let us see the restrictions now.
Number of items of type A produce are x and for each item processing time
required on machine G is 1 minute.
Number of items of type B produce are y and for each item processing time
required on machine G is 1 minute.
So 1 𝑥 +1 𝑦 ≤ 400 or 𝑥+ 𝑦 ≤ 400
Similarly
So 2 𝑥+ 𝑦 ≤ 600
At the same time one can produce the items but negative production is
meaning less and is not acceptable in OR.
Therefore 𝑥≥0, 𝑦 ≥0
Now the problem is Maximize Z = 2x + 3y
Another way of formulate the above problem
Profit Rs 2 Rs 3
per Unit
Net profit = 8x + 5y
Market limit on the first type of hat is x ≤ 150
Market limit on the second type of hat is y ≤ 250
Based on time x = 2y
Subjected to
A firm can produce 3 types of cloth A, B and C. Three kinds
of wool Red, Green and Blue are required for it. One unit
length of type A cloth requires 2 meters of red wool and 3
meters of blue wool. One unit length of type B cloth requires
3 meters of red wool, 2 meters of blue wool and 2 meters of
green wool. One unit of type C cloth needs 5 meters of green
wool and 4 meters of blue wool. There is 50 meters of red
wool, 80 meters of green wool and 60 meters of blue wool
available. It is assumed that the income obtained from one
unit length of type A cloth is Rs 3, of type B cloth is Rs 5 and
of type C cloth is Rs 4. Formulate the problem.
Subjected to
A patient consult a doctor to check up his health. Doctor
examines him and advises him to take two vitamins, vitamin A
and vitamin D regularly for a period of time so that he can
regain his health. Doctor prescribes tonic X and tonic Y, which
are having vitamin A, and D in certain proportion. Also advises
the patient to consume at least 40 units of vitamin A and 50
units of vitamin D daily. The costs of tonics X and Y per unit
are Rs 5 and 3 respectively. X contains 2 units of A and 3
units of D and Y contains 4 units of A and 2 units of D.
Formulate LPP to minimize the cost of tonics.
A 2 4 40
D 3 2 50
Cost in Rs 5 3
per Unit
Objective function is 𝑀𝑖𝑛 𝑍=5 𝑥 1+ 3 𝑥2
Subjected to 2 𝑥1 + 4 𝑥 2 ≥ 40
3 𝑥 1+ 2 𝑥 2 ≥ 50
𝑥1 𝑎𝑛𝑑 𝑥 2 ≥ 0
Solve the following LPP
Max Z = 3x + 5y
Subjected to x + 2y ≤ 2000, x + y ≤ 1500, y ≤ 600 and x, y ≥ 0
As x and y are greater than or equal to zero, The solution space must be in the first
quadrant . Now go to the constraints
1st constraint is x + 2y ≤ 2000, The maximum limiting condition for this constraint
is
x + 2y = 2000
So the equation x + 2y = 2000 can be represented by a line joining the points (0,
1000) and (2000, 0)
Similarly the equation x + y = 1500, obtained from the second constraint can be
represented by the line joining the points (0, 1500) and (1500, 0)
In the same way by converting the in-equation given as the third constraint will be
converted into equation y = 600 and it can be represented by a horizontal line
passing through the point (0, 600) on y axis
𝐼𝑓 𝑥 2=0 , 𝑥 1=3
So the equation is represented by a line joining (0, 1) and (3, 0)
And the area above the line in the graph satisfies the in equation
So the equation is represented by a line joining (0, 2) and (2, 0). And the
area above the line in the graph satisfies the in equation
Now draw the graph based on the above data All the points in the
common area (Above
ABC) satisfies all the
constraints
So the line joining the points (0, -1) and (1,0) represents the above
equation
So the line joining the points (0, 3) and (3, 0) represents the above
equation
Represent the above lines on the graph
All the points on the line (a) satisfies the first equation and the points above the line
satisfies the first in equation or constraint
Similarly all the points on the line (b) satisfies the second equation and the points
above the line satisfies the second in equation or constraint
B
The problem is maximization type and there
is no limit for the upper boundary
𝑥1
Solve the following LPP , ST
So the line joining the points (0, 1) and (1,0) represents the above equation
So the line joining the points (0, 2) and (2, 0) represents the above equation
All the points on the line CD satisfies the equation 2 and the points below the line
satisfies the in-equation 4
B D 𝑥1
𝑀𝑎𝑥 𝑍=8000 𝑥 1 +7000 𝑥2
Subjected to 3 𝑥 1+ 𝑥 2 ≤66 45 𝑥1 ≤ 20𝑥 2 ≤ 40𝑥1 , 𝑥2 ≥ 0
𝑀𝑎𝑥 𝑍=𝑥 1+ 𝑥 2
Subjected to 𝑥1 − 𝑥 2 ≥ 0 −3 𝑥 1 + 𝑥2 ≥ 3 𝑥1 , 𝑥2 ≥ 0
Simplex Method
Algorithm
Step 1: Express the problem in standard form
Convert the right hand side of the constraints into non-negative values.
Convert the in- equations into equations by adding slack variables to the left hand
side of the constraints if the constraints are less than are equal to type. Subtract
the surplus variables from the left hand side of the constraints if the constraints
are greater than or equal to type.
All the variables appear in the constraints should appear in the objective function.
So multiply the slack variables or surplus variables with zero and add it to the
objective function because there should not be any change in the objective function
due to slack or surplus variables.
If the surplus variables are appears in the problem Artificial Variables should be
introduced (Discussed Later).
As the minimum values of decision variables are zero, substitute zero in place of
decision variables and find out the values of slack variables. It becomes the IBFS.
Then form the simplex table.
Simplex Table
b θ
Basic Body matrix Identity matrix
Variables
0
0
𝑍 𝑗 =∑ 𝐶 𝐵 𝑥 𝑖𝑗
Significance of the above terms will be explained wile solving the problem
Step 3: Perform the optimality test
Find the value of Zj for each column of the simplex table
Select the row having minimum non negative θ value as key row
Select the element at the intersection of key column and key row as key element
and made it Unity (1). Made all other elements of key column zero by conducting
row operations in the simplex table. Row operation will affect body matrix, identity
matrix and column b only.
Again conduct the optimality test and repeat the above procedure till optimum
solution is obtained.
Problem: Solve the following LPP by Simplex Method
Subjected to , , ,
In this problem all the values in the right hand side of the constraints is positive.
So there is no need of this step. Then Convert all the in-equations into equations.
In this problem the constraints are ≤ type, so to convert the constraints into
equations by adding a variable to the left hand side of the constraints. These
variables added to the left hand side of the constraints are called slack variables.
As the slack variables are appears in the constraints those should be include in the
objective function by multiply those with zero, so that there is no change in the value
of objective function.
Now we need to identify whether this solution is optimum (or) it can be improved.
To check it form the simplex table with the above available data
The available data is
Basic variables are s1, s2 and s3 and their values are 24, 21 and 9 respectively
Non basic variables are x1 and x2 and both are equal to zero. With this data
form the simplex table
cj 2 5 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables (BV)
0 𝑠1 1 4 1 0 0 24
0 𝑠2 3 1 0 1 0 21
𝑠3
0 1 1 0 0 1 9
Write the coefficients of the variable in the row c j using objective function
Fill the second row (Row corresponding to using the coefficients in the second equation
Fill the third row (Row corresponding to using the coefficients in the third equation
Now to check whether the IBFS is optimum or not find
2 5 0 0 0
BV b θ
0 1 4
KE
1 0 0 24 24/4=6
KR←
0 3 1 0 1 0 21 21/1=21
0 1 1 0 0 1 9 9 /1=9
There are two non negative values 2 and 5 in row. So IBFS is not optimum.
Select the column having highest non negative value as key column (column
corresponding to ) and find out θ values for each row as
Select the row having least non negative value as key row (row corresponding to
Select the intersection of key column and key row as key element (Cell having 4)
Made the key element 1 by dividing the entire row with 4. During this step there is no
change in the remaining rows. So
cj 2 5 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
0 s1 1/4 4/4=1 1/4 0/4=0 0/4=0 24/4=6
0 s2 3 1 0 1 0 21
0 s3 1 1 0 0 1 9
cj 2 5 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
0 s1 1 0 0 6
0 s2 3 1 0 1 0 21
0 s3 1 1 0 0 1 9
Now made all other elements except key element of key column (x2 column) zero by performing
only the row operations. Now s1 in the BV is outgoing variable and x2 becomes incoming
variable. In this step replace s1 with x2 and corresponding coefficient 0 with 5 in CB column.
There is no change in the other values of key row. The row operations to be performed are
cj 2 5 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
0 s1 1 0 0 6
0 s2 3 1 0 1 0 21
0 s3 1 1 0 0 1 9
cj 2 5 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
5 x2 1 0 0 6
0 s2 1 11 1 1
3− = 1 - 1= 0 0− =− 1–0=1 0–0=0 21 – 6 = 15
4 4 4 4
0 s3 1 3 1 1
1− = 1 - 1= 0 0− =− 0–0=0 1–0=1 9–6=3
4 4 4 4
This solution is the second basic feasible solution. Again find out to identify
whether the second basic feasible solution is optimum or not
cj 2 5 0 0 0 b θ=
b/KC
CB Basic x1 x2 s1 s2 s3
variables
6
5 x2 1 0 0 6 =24
0 s2 1/4
15 60
=
11/ 4 11
0 s3
3
=4
KE 3/ 4KR
←
1 −1 −1 5
5x1+0
X0+0 5 × +0 × +0 × = 5X0+0
X1+0X
5X0+0
X0+0X
5X6+0
X15+0
X0=5
4 4 44 0=0 1=0 X3=30
5 3 5–5=0 5 5
2− = 0 − =− 0 – 0 = 0 0–0=0
4 4 4 4
KC↑
Still there is one positive value in row (corresponding to x 1 ). So select the first
column having highest non negative value as key column and find the θ values
cj 2 5 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
5 x2 1 0 0 6
0 s2
0 s3
cj 2 5 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
5 x2 1 0 0 6
0 s2
0 s3
4 3 4 4 −1 −1 4 4
× =𝟏 × 0= 0 × = 4 × 0= 0 × 1= 3 × 4 = 4
3 4 3 3 4 33 3 3 3
cj 2 5 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
5 x2 1 0 0 6
0 s2
0 s3 1 0 0 4
Now perform the row operations to made other elements except key element of key
column zero. The row operations to be performed are Replace s 3 with x1 in BV column
cj 2 5 0 0 0 b
CB BV x1 x2 s1 s2 s3
1 1 1 1 1 1
5 x2 − × 1= 0 1 + × = =0 =
6−
1
4=5
4 4 4 4 3 3 4
0 s2
11 11 0 11
− ×1=0 −1 11 1 2 =
15 − 4=
4 4 + × = =1
4
4 4 3 3
2 x1 1 0 0 4
The solution in the above table x2 = 5 and x1 = 4 is the third basic feasible solution.
Now check whether this solution is optimum or not by finding
cj 2 5 0 0 0 b
CB BV x1 x2 s1 s2 s3
5 x2 0 1 0 5
0 s2 0 0 1 4
2 x1 1 0 0 4
1 2 −1
5×0+0×0+2×1=2
5×1+0×0+2×0=55× +0× +2× =1 5 × 5 + 0 × 4 + 2 × 4 =3
0 1
3 3 3
2-2=0 5-5=0 0-1=-1 0-0=0 0-1=-1
Now all the values in the row are non positive, so the solution x 2 = 5 and x1 = 4 is the
optimum solution.
Subjected to
Solution
Convert the problem into standard form
Convert all the in equations into equations by adding slack
variables as all the constraints are less than or equal to type.
CB Basic x1 x2 x3 s1 s2 s3
variables (BV)
0 𝑠1 2 3 2 1 0 0 440
0 𝑠2 4 0 3 0 1 0 470
0 𝑠3 2 5 0 0 0 1 430
Write the coefficients of the variable in the row cj using the objective function
Fill the second row (Row corresponding to using the coefficients in the second
equation
Fill the third row (Row corresponding to using the coefficients in the third
equation
Now to check whether the IBFS is optimum or not find
cj 4 3 6 0 0 0 b θ
CB Basic x1 x2 x3 s1 s2 s3
variables
0 s1 2 3 2 1 0 0 440 220
0 s2 4 0 3 KE 0 1 0 470 470/3
KR←
∞
0 s3 2 5 0 0 0 1 430
0*2+0* 0*3+0* 0*2+0* 0*1+0* 0*0+0* 0*0+0*
4+0*2= 0+0*5= 3+0*0= 0+0*0= 1+0*0= 0+0*1=
0 0 0 0 0 0
4-0=4 3-0=3 6-0=6 0-0=0 0-0=0 0-0=0
𝐊𝐂 ↑
There are three non negative values in row. So IBFS is not optimum.
To move towards optimum solution select the column having highest non
negative value as key column and find out θ values for each row as
Select the row having least non negative value as key row (row corresponding
to . Select the intersection of key column and key row as key element (Cell
having 4)
Made the key element 1 by dividing the entire row with 3. During this step
there is no change in the remaining rows. So
cj 4 3 6 0 0 0 b θ
CB Basic variables x1 x2 x3 s1 s2 s3
0 s1 2 3 2 1 0 0 440
4/3 0/3=0 3/3=1 0/3=0 1/3 0/3=0 470/3
0 s2
0 s3 2 5 0 0 0 1 430
0 0 0 0 0 0
4 3 6 0 0 0
cj 4 3 6 0 0 0 b θ
CB Basic variables x1 x2 x3 s1 s2 s3
0 s1 2 3 2 1 0 0 440
0 s2 4/3 0 1 0 1/3 0 470/3
0 s3 2 5 0 0 0 1 430
Now made all other elements except key element of key column zero. Now s 2
in the BV is outgoing variable and x3 becomes incoming variable. So replace
s2 with x3 and corresponding coefficient 0 with 6 in CB column.
There is no change in the values of key row. The row operations to be
performed is there is no need to operate because already the corresponding
element is Zero
cj 4 3 6 0 0 0 b θ
CB Basic x1 x2 x3 s1 s2 s3
variables
0 s1 2-2*4/3 3-2*0 2 - 2*1 1-2*0 0 – 2*1/3 0 – 2*0
= - 2/3 =3 =0 =1 = - 2/3 =0
6 x3 4/3 0 1 0 1/3 0 470/3
0 s3 2 5 0 0 0 1 430
cj 4 3 6 0 0 0 b θ
CB Basic variables x1 x2 x3 s1 s2 s3
380/9
0 s1 - 2/3 3 KE 0 1 - 2/3 0 380/ KR←
3 ∞
6 4/3 0 1 0 1/3 0 470/ 86
x3
8 0 6 0 2 0 3
0 s3 2 5 0 0 0 1 430
-4 3 0 0 -2 0
𝐊𝐂 ↑
cj 4 3 6 0 0 0 b θ
CB Basic variables x1 x2 x3 s1 s2 s3
0 s1 - 2/3 3 0 1 - 2/3 0 380/3
6 x3 4/3 0 1 0 1/3 0 470/3
0 s3 2 5 0 0 0 1 430
Made the key element unity by dividing entire key row with key element
cj 4 3 6 0 0 0 b θ
CB Basic variables x1 x2 x3 s1 s2 s3
0 -2/9 1 0 1/3 -2/9 0 380/9
s1
6 x3 4/3 0 1 0 1/3 0 470/3
0 s3 2 5 0 0 0 1 430
Perform the row operation to made other elements of key row zero.
need not be operated because the corresponding cell already contains
zero. During this step should be replaced with and the corresponding
coefficients also should be replaced
cj 4 3 6 0 0 0 b θ
CB Basic variables x1 x2 x3 s1 s2 s3
0 s1 - 2/9 1 0 1/3 - 2/9 0 380/9
6 x3 4/3 0 1 0 1/3 0 470/3
0 s3 2 5 0 0 0 1 430
cj 4 3 6 0 0 0 b θ
CB Basic x1 x2 x3 s1 s2 s3
variables
3 x2 - 2/9 1 0 1/3 - 2/9 0 380/9
6 x3 4/3 0 1 0 1/3 0 470/3
()
0 s3
()
1 5 2 10 380 1970
2 28 5– 0 – 5*0 1-
2−5∗ − = 5*1 =0
0−5∗ =− 0−5 − = 5*0
430−5∗ =
9 9 =0 =1
9 9
3 3 9 9
Again perform the optimality test to check whether this solution is optimum or
not
Again find out
cj 4 3 6 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
3 x2 - 2/9 1 0 1/3 - 2/9 0 380/9
6 x3 4/3 0 1 0 1/3 0 470/3
0 s3 28/9 0 0 -5/3 10/9 1 1970/9
2 4 28 𝟐𝟐 3*1+ 1 5
𝑍 𝑗 =∑
3*0+
𝑐 𝑗− 𝑍 𝑗 - 10/3 0 0 -1 - 4/3 0
All the values in the row are non positive, So the above solution is
optimum
So , , and = = 0
3200
𝑍 𝑚𝑎𝑥 =
3
Subjected to
Solution
Convert the problem into standard form
Convert all the in equations into equations by adding slack
variables as all the constraints are less than or equal to type.
cj 2 1 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables (BV)
0 𝑠1 4 3 1 0 0 12
0 𝑠2 4 1 0 1 0 8
𝑠3
0 4 -1 0 0 1 8
Fill the second row (Row corresponding to using the coefficients in the second equation
Fill the third row (Row corresponding to using the coefficients in the third equation
Now to check whether the IBFS is optimum or not find
2 1 0 0 0
BV b θ
0 4 3 1 0 0 12 12/ 4=3
0 4 1 0 1 0 8 8 /4=2
0 4 KE -1 0 0 1 8 8 /4=2
2𝐊𝐂 ↑ 1 0 0 0
There are two non negative values 2 and 1 in row. So IBFS is not optimum.
cj 2 1 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
0 s1 4 3 1 0 0 12
0 s2 4 1 0 1 0 8
4/4=1 -1/4 0/4=0 0/4=0 1/4 8/4=2
0 s3
cj 2 1 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
0 s1 4 3 1 0 0 12
0 s2 4 1 0 1 0 8
0 s3 1 - 1/4 0 0 1/4 2
Made other elements of key element of key column zero by performing the
following row operations. Now s3 in the BV is outgoing variable and x1 is
incoming variable. So replace s3 with x1 and corresponding values of CB. The
row operations to be performed are
cj 2 1 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
0 s1 4 3 1 0 0 12
0 s2 4 1 0 1 0 8
0 s3 1 - 1/4 0 0 1/4 2
( )
1
0 s1
1- 4*0 0 - 4*0 -1 12 -
4 – 4*1=0 3−4 − = 4 =1 =0 4*2 = 4
4
1−4 ( − )=2
0 s2
4 – 4*1=0 1 0 - 4*0 1 - 4*0
-1
8 - 4*2
4 =0 =1 =0
2 x1 1 - 1/4 0 0 1/4 2
cj 2 1 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
0 s1 0 4 1 0 -1 4
0 s2 0 2 0 1 -1 0
2 x1 1 - 1/4 0 0 1/4 2
0*4+0*2 0*(-1)
0*0+0*0 0*1+0*0 0*0+0*1 +0*(-1)
+2*1= 2 -2*1/4=
-1/2 +2*0= 0 +2*0= 0 +2*1/4=
1/2
0 3/2 0 0 -1/2
KC↑
cj 2 1 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
0 s1 0 4 1 0 -1 4
0 s2 0 2 0 1 -1 0
2 x1 1 - 1/4 0 0 1/4 2
cj 2 1 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
0 s1 0 4 1 0 -1 4
0 s2 0/2=0 2/2=1 0/2=0 1/2 - 1/2 0/2=0
2 x1 1 - 1/4 0 0 1/4 2
Now made all other elements of the key column zero by performing the row
operation and
Replace s2 with x2
cj 2 1 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables
0 s1 0 4 1 0 -1 4
0 s2 0 1 0 1/2 - 1/2 0
2 x1 1 - 1/4 0 0 1/4 2
and
cj 2 1 0 0 0 b θ
CB Basic x1 x2 s1 s2 s3
variables KR ←
0 s1 0 0 1 -2 1 KE 4 4/1=4
1 x2 0 1 0 1/2 - 1/2 0 0/(-0.5)=
- ve
2 x1 2/(1/8)
1 0 0 1/8 1/8 2 = 16
2 1 0 3/4 -1/4
0 0 0 -3/4 1/4
KC↑
Made the key element unity. But the key element is already 1. So made the
other elements of key column zero . Replace s1 with s3
cj 2 1 0 0 0 b θ
CB BV x1 x2 s1 s2 s3
0 s3 0 0 1 -2 1 4
1 x2 0 1 0 1/2 - 1/2 0
2 x1 1 0 0 1/8 1/8 2
Row operations should be performed are and
cj 2 1 0 0 0 b θ
CB BV x1 x2 s1 s2 s3
0 s3 0 0 1 -2 1 4
1 x2 0 1 1/2 -1/2 0 2
2 x1 1 0 -1/8 3/8 0 3/2
2 1 1/4 1/4 0
0 0 -1/4 -1/4 0
Subjected to
Solution
In the second constraint the right hand side is negative, so first of all
convert it to positive by multiplying both sides of the constraint with –
1. Then the constraints becomes
Problem is minimization type, so change the problem into
maximization type by multiplying the objective function with – 1. So
the problem becomes
Subjected to
So the variables are basic variables as these are having values. With
this data form the simplex table.
cj -1 3 -3 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
0 s1 3 -1 2 1 0 0 7
0 s2 -2 -4 0 0 1 0 12
0 s3 -4 3 8 0 0 1 10
-1 3 KC↑ -3 0 0 0
cj -1 3 -3 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
0 s1 3 -1 2 1 0 0 7
0 s2 -2 -4 0 0 1 0 12
0 s3 -4/3 1 8/3 0 0 1/3 10/3
Made all other elements of key column zero by performing row operations
and
cj -1 3 -3 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
0 s1 3 -1 2 1 0 0 7
0 s2 -2 -4 0 0 1 0 12
0 s3 -4/3 1 8/3 0 0 1/3 10/3
and
cj -1 3 -3 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
0 5/3 KE 0 14/3 1 0 1/3 31/3 31/5 KR←
s1
-22/3 0 32/3 0 1 4/3 76/3 - 38/11
0 s2
-5/2
3 x2 -4/3 1 8/3 0 0 1/3 10/
-4 3 8 0 0 1
3
3 0 -11 0 0 -1
KC↑
Still there is a positive value in the last row. So this solution is not optimum.
So again go for the selection of key element and continue the procedure.
cj -1 3 -3 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
0 s1 5/3 0 14/3 1 0 1/3 31/3
0 s2 -22/3 0 32/3 0 1 4/3 76/3
3 x2 -4/3 1 8/3 0 0 1/3 10/3
Made key element unity by performing row operation
cj -1 3 -3 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
1 0 14/5 3/5 0 1/5 31/5
0 s1
0 s2 -22/3 0 32/3 0 1 4/3 76/3
3 x2 -4/3 1 8/3 0 0 1/3 10/3
Made other two elements of the key column zero by performing row operation
and In this step replace with
cj -1 3 -3 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
0 s1 1 0 14/5 3/5 0 1/5 31/5
0 s2 -22/3 0 32/3 0 1 4/3 76/3
3 x2 -4/3 1 8/3 0 0 1/3 10/3
and
cj -1 3 -3 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
-1 x1 1 0 14/5 3/5 0 1/5 31/5
0 0 156/5 22/5 1 14/5 354/5
0 s2
0 1 32/5 4/5 0 3/5 58/5
3 x2
. And
Now
Subjected to
cj 2 3 4 0 0 b θ
CB Basic variables x1 x2 x3 s1 s2
0 s1 3 1 4 1 0 600
0 s2 2 4 2 0 - 1 - 480
2 3 3 0 0 540
Here the problem is there are three constraints, but there are having only
two basic variables.
Another thing is while forming the first simplex table there must be one
identity (Unit) matrix. But here in the simplex table there is no identity
matrix.
There are two methods to solve the problems having artificial variables (i) Big
– M method, (ii) Two Phase simplex method.
Big – M method
To find the IBFS take the decision variables and surplus variables as
zero.
So . Then , , .
Now basic variables are . With this data form the simplex table.
cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 𝑠1 3 1 4 1 0 0 0 600
-M 𝐴1 2 4 2 0 -1 1 0 480
-M 𝐴2 2 3 3 0 0 0 1 540
Take the first equation / constraint and using the coefficients of variables fill
the first row of the matrix
Take the second equation / constraint and using the coefficients of variables
fill the second row of the matrix
Take the third equation / constraint and using the coefficients of variables
fill the third row of the matrix
From the table one can say that 𝑠1=600 𝐴 1=600 𝐴 2=600
Select the key column having highest positive value. So the column
corresponding to is the key column
Second row is having θ value 120 (min). So second row becomes key row and
the value 4 in the cell X is the key is the key element 1
cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 3 1 4 1 0 0 0 600
-M A1 2 4 2 0 -1 1 0 480
-M A2 2 3 3 0 0 0 1 540
Now made the key element unity by performing row operation
cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 3 1 4 1
600 0 0 0
2 1 4 2 1 0 − 1 1 0 =0 120
-M A1 = =1 = =0 4
4 2 4 4 2 4 4 4
-M A2 2 3 3 0 0 0 1 540
cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 3 1 4 1 0 0 0 600
-M A1 1/2 1 1/2 0 -1/4 1/4 0 120
-M A2 2 3 3 0 0 0 1 540
cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 3 1 4 1 0 0 0 600
-M A1 1/2 1 1/2 0 -1/4 1/4 0 120
-M A2 2 3 3 0 0 0 1 540
Make all other elements in the key column zero. The row operations to be
performed are ,
Replace with
cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1𝟑 − 𝟏 = 𝟓 1-1=0 4 1-0=1 𝟎 −(−
𝟏 𝟏 𝟏 −𝟏 0-
)= 𝟎 − =
600-
𝟐 𝟐 𝟒 𝟒 𝟒 𝟒 0=0 120=
480
3 x2 1/2 1 1/2 0 -1/4 1/4 0 120
-M A2 2 3-3*1
0-3*0 𝟏 𝟑 1-3*0 540-
=0
=0 𝟎−𝟑(− )= =1 3*120
𝟒 𝟒 =180
cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 5/2 0 7/2 1 1/4 -1/4 0 480
3 x2 1/2 1 1/2 0 -1/4 1/4 0 120
-M A2 1/2 0 3/2 0 3/4 -3/4 1 180
Now check whether this solution is optimum or not
cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 5/2 0 7/2 1 1/4 -1/4 0 480 960/7
cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 5/2 0 7/2 1 1/4 -1/4 0 480
3 x2 1 1/2
2 1 1
23 1/2
2 0∗ 0 2 𝟏 −3 1/4
2 3 -1/4 2 −𝟏 0
2 2
120
∗ = 0 ∗ =0 ∗ =1 =0∗ =
-M A2 2 3 3 3 2 3 3 4 3 𝟐 ∗ = 1 ∗ 3 = 3 120
4 3 𝟐
cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 5/2 0 7/2 1 1/4 -1/4 0 480
3 x2 1/2 1 1/2 0 -1/4 1/4 0 120
-M A2 1/3 0 1 0 1/2 -1/2 2/3 120
cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
0 s1 5/2 0 7/2 1 1/4 -1/4 0 480
3 x2 1/2 1 1/2 0 -1/4 1/4 0 120
-M A2 1/3 0 1 0 1/2 -1/2 2/3 120
Make the other two elements of key column zero
Row operations to be performed are
cj 2 3 4 0 0 -M -M b θ
CB BV x1 x2 x3 s1 s2 A1 A2
4/3 0 0 1 -3/2 3/2 -7/3 60
0 s1
1/3 1 0 0 -1/2 1/2 -1/3 60
3 x2
4 x3 1/3 0 1 0 1/2 -1/2 2/3 120
𝑐 𝑗− 𝑍 𝑗 -1/3 0 0 0 -1/2
−2 𝑀 + 1−3 𝑀 − 5
2 3
Here all the values are non positive as “– M” is very large negative number.
So the above solution is optimum
Hence
Two Phase Simplex Method
Subjected to
In the first phase of the two phase simplex method take the values of all the
variables as zero except artificial variables. For artificial variable take as – 1
cj 0 0 0 0 0 0 -1 b θ
CB BV x1 x2 x3 s1 s2 s3 A1
0 s1 5 7 4 1 0 0 0 7
0 s2 4 -7 -5 0 1 0 0 2
-1 A1 3 4 -6 0 0 -1 1 29/7
Now check whether the above solution is optimum or not by conducting optimality test
cj 0 0 0 0 0 0 -1 b θ
CB BV x1 x2 x3 s1 s2 s3 A1
0 s1 5 7KE 4 1 0 0 0 7 7/7=1
-2/7
0 s2 4 -7 -5 0 1 0 0 2
-1 A1 3 4 -6 0 0 -1 1 29/7 29/28
𝑍 𝑗 =∑ 𝐶 𝐵 𝑥 0*3+0*
𝑖𝑗 4 - 1*3
0*7+0* 0*4+0* 0*1+0* 0*0+0* 0*0+0*
-7 -1*4 5 -1*-6 0 -1*0 1-1*0 0 -1*-1
0*0+0*
0 -1*1
=-3 =-4 =6 =0 =1 = -1 KR←
=0
𝑐 𝑗− 𝑍 𝑗 3 4 -6 0 0 -1 0
KC↑
Now make the key element 1 by operate the 1st row as
cj 0 0 0 0 0 0 -1 b θ
CB BV x1 x2 x3 s1 s2 s3 A1
5/7 7/7=1 4/7 1/7 0/7=0 0/7=0 0/7=0 7/7=1
0 s1
0 s2 4 -7 -5 0 1 0 0 2
-1 A1 3 4 -6 0 0 -1 1 29/7
cj 0 0 0 0 0 0 -1 b θ
CB BV x1 x2 x3 s1 s2 s3 A1
0 s1 5/7 1 4/7 1/7 0 0 0 1
0 s2 4 -7 -5 0 1 0 0 2
-1 A1 3 4 -6 0 0 -1 1 29/7
Now make all other elements of key column zero. For that the row operations
to be performed are and
cj 0 0 0 0 0 0 -1 b θ
CB BV x1 x2 x3 s1 s2 s3 A1
0 x2 5/7 1 4/7 1/7 0 0 0 1
9 0 -1 1 1 0 0 9
0 s2
1/7 0 -58/7 -4/7 0 -1 1 1/7
-1 A1
cj 0 0 0 0 0 0 -1 b θ
CB BV x1 x2 x3 s1 s2 s3 A1
0 x2 5/7 1 4/7 1/7 0 0 0 1
0 s2 9 0 -1 1 1 0 0 9
1 0 -58 -4 0 -7 7 1
-1 A1
Make all other elements of key column zero by row operations and
cj 0 0 0 0 0 0 -1 b θ
CB BV x1 x2 x3 s1 s2 s3 A1
0 x2 5/7 1 4/7 1/7 0 0 0 1
0 s2 9 0 -1 1 1 0 0 9
-1 A1 1 0 -58 -4 0 -7 7 1
and Replace with
cj 0 0 0 0 0 0 -1 b θ
CB BV x1 x2 x3 s1 s2 s3 A1
0 0 1 42 3 0 5 -5 2/7
x2
0 0 521 37 1 63 -63 0
0 s2
0 x1 1 0 -58 -4 0 -7 7 1
Now all the artificial variables are eliminated from BV column. So this is the
end of the first phase
In the second phase take this final simplex table of the first phase by
excluding artificial variables columns and original values of
cj 3 2 2 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
2 x2 0 1 42 3 0 5 2/7
0 s2 0 0 521 37 1 63 0
3 x1 1 0 -58 -4 0 -7 1
Now check whether this solution is optimum or not by conducting optimality
test
cj 3 2 2 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
2 0 1 42 3 0 5 2/7 1/147
x2
KE 0 KR←
0 s2 0 0 521 37 1 63 0
- 1/58
3 x1 1 0 -58 -4 0 -7 1
3 2 - 90 -6 0 - 11
0 0 92 6 0 11
KC↑
cj 3 2 2 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
2 x2 0 1 42 3 0 5 2/7
0 0 0 1 37/521 1/521 63/521 0
s2
3 x1 1 0 -58 -4 0 -7 1
Replace with
cj 3 2 2 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
2 x2 0 1 42 3 0 5 2/7
2 x3 0 0 1 37/521 1/521 63/521 0
3 x1 1 0 -58 -4 0 -7 1
and
cj 3 2 2 0 0 0 b θ
CB BV x1 x2 x3 s1 s2 s3
2 0 1 0 9/521 -42/521 -41/521 2/7
x2
2 x3 0 0 1 37/521 1/521 63/521 0
1 0 0 62/521 58/521 7/521 1
3 x1
All the values in the row are non positive. So this solution is optimum
The solution is
2 25
𝑍 𝑚𝑎𝑥 =3 ∗1+ 2∗ + 2∗ 0=
7 7
Subjected to
Find out Initial Basic Feasible Solution by taking the values of all decision
and surplus variables as zero.
𝑥1 =𝑥2 =𝑠 1=𝑠 3=0
Then IBFS is obtained as , ,
Now form the simplex table using the following equations
4 5 0 0 0 -M -M b θ
BV
-M 1 1 -1 0 0 1 0 1
0 -2 1 0 1 0 0 0 1
-M 4 -1 0 0 -1 0 1 1
4 5 0 0 0 -M -M b θ
BV
-M 0 5/4 - 1 0 1/4 1 -1/4 3/4
0 0 1/2 0 1 -1/2 0 1/2 3/2
1 -1/4 0 0 -1/4 0 1/4 1/4
4 5 0 0 0 -M -M b θ
BV
-M 0 5/4 -1 0 1/4 1 -1/4 3/4
0 0 1/2 0 1 -1/2 0 1/2 3/2
1 -1/4 0 0 -1/4 0 1/4 1/4
4 5 0 0 0 -M -M b θ
BV
KR
-M 0 5/4KE -1 0 1/4 1 -1/4 3/4 3/5
0 0 1/2 0 1 -1/2 0 1/2 3/2 -1
1 -1/4 0 0 -1/4 0 1/4 1/4 -1
−5 𝑀 − 4 − 𝑀 − 4 -M 𝑀+4
-M 0
4 4 4 4
5 𝑀+24 𝑀+4 −5 𝑀 − 4
0 M 0 0
4 4 4
KC
4 5 0 0 0 -M -M b θ
BV
-M 0 5/4 -1 0 1/4 1 -1/4 3/4
0 0 1/2 0 1 -1/2 0 1/2 3/2
1 -1/4 0 0 -1/4 0 1/4 1/4
4 5 0 0 0 -M -M b θ
BV
-M 0 1 -4/5 0 1/5 4/5 -1/5 3/5
0 0 1/2 0 1 -1/2 0 1/2 3/2
1 -1/4 0 0 -1/4 0 1/4 1/4
and
4 5 0 0 0 -M -M b θ
BV
5 0 1 -4/5 0 1/5 4/5 -1/5 3/5
0 0 0 -2/5 1 -2/5 2/5 2/5 4/5
1 0 -1/5 0 -1/5 1/5 1/5 2/5
−5 𝑀 − 24 −5 𝑀 − 1
0 0 24/5 0 -1/5 5
5
KC
Now all the values in the minimum ratio column (θ) are negative. So
we can not select the key row. So the solution is unbounded
Subjected to
Find out Initial Basic Feasible Solution by taking the values of all decision
and surplus variables as zero.
𝑥1 =𝑥2 =𝑠 2=0
Then IBFS is obtained as 8,
Now form the simplex table using the following equations
2 3 0 0 0 -M b θ
BV
0 1 -3 1 0 0 0 6
-M 2 4 0 -1 0 1 8
0 -1 3 0 0 1 0 6
Check whether this solution is optimum or not
2 3 0 0 0 -M b θ
BV
0 1 -3 1 0 0 0 6 -2
-M 2 4 0 -1 0 1 8 2
0 -1 3 KE 0 0 1 0 6 2 KR
-2M -4M 0 M 0 -M
2+2M 3+4M 0 -M 0 0
KC
Make the key element 1 by dividing the row 3 with 3.
2 3 0 0 0 -M b θ
BV
0 1 -3 1 0 0 0 6
-M 2 4 0 -1 0 1 8
0 -1/3 1 0 0 1/3 0 2
2 3 0 0 0 -M b θ
BV
0 0 0 1 0 1 0 12
-M 10/3 0 0 1 -4/3 1 0
-1/3 1 0 0 1/3 0 2
2 3 0 0 0 -M b θ
BV
0 0 0 1 0 1 0 12
-M 10/3 0 0 1 -4/3 1 0
-1/3 1 0 0 1/3 0 2
2 3 0 0 0 -M b θ
BV
0 0 0 1 0 1 0 12
-M 1 0 0 3/10 -2/5 3/10 0
-1/3elements
Make other two 1 of0 key column
0 1/3 0 row operations
zero by 2
2 3 0 0 0 -M b θ
BV
0 0 0 1 0 1 0 12
-M 1 0 0 3/10 -2/5 3/10 0
-1/3 1 0 0 1/3 0 2
2 3 0 0 0 -M b θ
BV
0 0 0 1 0 1 0 12
2 1 0 0 3/10 -2/5 3/10 0
0 1 0 1/10 1/5 1/10 2
Check whether this solution is optimum or not
2 3 0 0 0 -M b θ
BV
0 0 0 1 0 1 0 12
2 1 0 0 3/10 -2/5 3/10 0
0 1 0 1/10 1/5 1/10 2
2 3 0 9/10 -1/5 9/10
0 0 0 -9/10 1/5 -M-
9/10
Now all the values in the minimum ratio column (θ) are negative. So
we can not select the key row. So the solution is unbounded
Subjected to
5 3 0 0 -M b θ
BV
0 2 1 1 0 0 1
-M 1 4 0 -1 1 6
5+M 3+4M 0 -M 0
KC
Key element is already zero. So make all other elements of the
key column zero. The operation to be performed is
5 3 0 0 -M b θ
BV
3 2 1 1 0 0 1
-M -7 0 -4 -1 1 2
Check for optimality of the above solution
5 3 0 0 -M b θ
BV
3 2 1 1 0 0 1
-M -7 0 -4 -1 1 2
7M+6 3 4M+3 M -M
-7M-1 0 -4M-3 -M 0
Here all the values in are non positive , but still the artificial
variables are not eliminated from the simplex table. So the
solution is infeasible
Disadvantages of Simplex Method
The maximization problem of primal must have all ≤ type constraints and the
minimization have all ≥ type constraints.
The constants , , ,..….. in the objective function of the primal appears in the
constraints of the dual.
Subjected to
Duality
The primal is having 2 variables and 4 constraints, so the dual
will have 4 variables and 2 constraints.
Here in the problem all the variables are less than or equal to
type. So there is no need of conversion.
Variable in dual
Variable in dual
2 𝑦 1 +3 𝑦 2 +5 𝑦 3 ≥ 3
6 𝑦 1 +2 𝑦 2 −3 𝑦 3 +𝑦 4 ≥5
𝑦 1, 𝑦 2, 𝑦 3, 𝑦 4 ≥ 0
Construct the dual of the problem
Subjected to
Let the variables in the dual are y1, y2, y3, y4 and y5
6 𝑥 1+ 𝑥 2 +3 𝑥 3 ≥ 4
7 𝑥 1 −2 𝑥 2 − 𝑥 3 ≤10 −7 𝑥 1 +2 𝑥 2 + 𝑥 3 ≥ −10
𝑥1 −2 𝑥 2+5 𝑥 3 ≥ 3
4 𝑥1 +7 𝑥 2 − 2 𝑥 3 ≥ 2
𝑥1 , 𝑥2 , 𝑥 3 ≥ 0
Let the objective function in the dual is indicated by W
Variable in dual