Mca Notes - m-1
Mca Notes - m-1
Mca Notes - m-1
Linear Programming
To make a mathematical model we first recognize the parameters to be determined and represent them
by algebraic symbols. They are known as decision variables. The problem may have a well defined
objective. It may be maximization of the profit or minimization of the cost. We may represent the
objective by a mathematical function of the decision variables. This function is called the objective
function . The problem may be to maximize or minimize the objective function. Generally we say
optimization of the objective function. Generally determination of decision variables may be governed
by a number of practical limitations due to availability of resources like men, material or money or may
be due to quality constraints or those arise from a variety of other reasons. These limitations may be
represented by mathematical equations or inequalities. They are called constraint equations or
inequalities. The mathematical model of the problem may be to determine the values of the decision
variables so that the objective is optimized(maximized or minimized).
1) A manufacturer of furniture makes two products , chairs and tables. Processing of these products is
done on two machines A & B.A chair requires 2 hours on machine A and 6 hours on machine B.A table
requires 5 hours on machine A and no time on machine B. There are 16 hours of time per day available
on machine A and 30 hours on machine B. Profit gained by the manufacturer from a chair is Rs.1 and
from a table is Rs.5 respectively. Formulate the problem into a LPP in order to maximize the total
profit.
Module 1 Page 1
Let 𝑥1 be the number of chairs and 𝑥2 be the number of tables produced.
Max Z = 𝑥1 + 5𝑥2
subject to the constraints
2𝑥1 + 5𝑥2 ≤ 16
6𝑥1 ≤ 30
𝑥1 , 𝑥2 ≥ 0
2) A firm can produce 3 types of cloths say A , B and C. Three kinds of wool were required for it, say
red wool , green wool and blue wool. One unit length of type A cloth needs 2 yards of red wool and 3
yards of blue wool. One unit length of type B cloth needs 3 yards of red wool , 2 yards of green wool
and 2 yards of blue wool, and one unit length of type C cloth needs 5 yards of green wool and 4 yards
of blue wool. The firm has only a stock of 8 yards of red wool,10 yards of green wool and 15 yards of
blue wool. 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 mathematical model to the problem.
Let the firm produce 𝑥1 , 𝑥2 , 𝑥3 yards of the 3 types of cloths A,B & C resp.
3) An animal feed company must produce at least 200 kgs of a mixture consisting of ingredients A & B
daily. A costs Rs.3 per kg. and B Rs. 8 per kg. No more than 80 kg of A can be used and at least 60 kgs
of B must be used .Formulate a mathematical model to the problem.
Let 𝑥1 , 𝑥2 be the units of the ingredients A & B purchased.
Min Z = 3𝑥1 + 8𝑥2
subject to the constraints
𝑥1 + 𝑥2 ≥ 200
𝑥1 ≤ 80
𝑥2 ≥ 60
𝑥1 , 𝑥2 ≥ 0
Module 1 Page 2
4) A firm manufacturer has 3 products A , B ,C .The profit from A,B,C are Rs.6,Rs.4,Rs.8 resp. A firm
has two machines and given below is required processing time in minutes for each machines on each
product
machines Products
A B C
X 8 6 10
Y 4 4 8
Machines X & Y have 4000 and 5000 minutes .The firm must manufactures 200A’s , 400B’s and
100C’s but not more than 300A’s.Set up a linear programming problem to maximize the profit.
Module 1 Page 3
Degeneracy :-
A basic feasible solution of a LPP is said to be degenerate if at least one of the basic variables is zero.
One of the basic theorems of LPP is that the number of non zero valued variables in a LPP should be
equal to the no.of constraints . Therefore ,if one valued variables become one less than the number of
constraints(non basic variables are always zero).This situation is called degeneracy because from this
simplex table ,we cannot continue to reach next simplex table as the variable to be replaced is already
zero.
The main drawback of degeneracy is the increase in the computation which reduces the efficiency
of the simplex method.
Degeneracy occurs in two stages a)the degeneracy appears in a LPP at the very first iteration.
b) degeneracy occurs in the subsequent iteration.
a) Degeneracy in the first iteration .Suppose the RHS of one of the constraints is zero ,then the
corresponding X B value will be zero so that one of the basic variables is zero. Therefore the solution
is degenerate.
b) Degeneracy in the subsequent iteration.-In the case of certain LPP’s there will be no degeneracy in
the first stage. But degeneracy may occur in a subsequent iteration. For example , in some problems
the simplex table may show two minimum ratios in a particular stage. In such cases there are more
than one outgoing vectors. In those cases degeneracy may occur when a particular outgoing vector is
chosen.
In these types of problems properly choosing minimum ratio , degeneracy can be avoided.
Unbounded solution:-
Another complication in the minimum ratio rule may occur when it is not able to determine the basic
variable to leave .This happens when none of the constraint coefficients of the non-basic variable
selected to enter the basis is positive. This means that no finite ratios can be formed and in effect the
minimum ratio rule failed.
Important definitions:-
Solution:- The set of values of decision variables Xj(j= 1,2,3…n) which satisfy the constraints of the LP
problem is said to that LPP ‘s solution.
Feasible solution:- The set of values of decision variables Xj(j = 1,2,3…n)which satisfy all the
constraints and non negativity conditions of an LPP simultaneously is said to constitute the feasible
solution.
Infeasible solution:- The set of values of decision variables Xj(j = 1,2,3…n)which do not satisfy all the
constraints and non negativity conditions of an LPP simultaneously is said to constitute the infeasible
solution.
Basic Solution:- For a set of m simultaneous equations in ‘n’ variables ( n > m) a solution obtained by
setting ‘n – m’ variables equal to zero and solving for remaining ‘m’ equations in ‘n’ variables is called
a basic solution. The n – m variables whose value did not appear in the solution are called non – basic
variables and the remaining variables are called basic variables.
Basic Feasible Solution (BFS):-
A feasible solution to an LPP which is also the basic solution is called BFS. ie, all basic variables
assume non negative values. BFS are of two types.
1. Degenerate: A BFS is called degenerate if the value of at least one basic variable is zero.
Module 1 Page 4
2. Non – Degenerate: A BFS is called non – degenerate if the value of all m basic variables
are non – zero and positive.
Optimal BFS:- A BFS which optimizes the objective function of the given LPP is called an Optimal
BFS.
Unbounded Solution:- A solution which can increase or decrease the value of the objective of the LPP
indefinitely is called an unbounded solution.
I. Graphical Method:
For LPP that have only two variable, it is possible that the entire set of feasible solutions can be
displayed graphically by plotting linear constraints on a graph paper to locate the best (optimal) solution.
This technique used to obtain the optimal solution is called the graphical method. The different steps for
solving LPP by graphical method are
1. Formulate the problem into a LPP
2. Each inequality in the constraints may be written as equality.
3. Draw straight lines corresponding to equations obtained in step 2. So there will be as many
straight lines as there are equations.
4. Identify the feasible region. Feasible region is the area which satisfies all the constraints
simultaneously.
5. The vertices of the feasible region are to be located and their co ordinates are to be measured.
6. Calculate the value of the objective function Z at each vertex.
7. The solution is the co ordinates of the vertex which optimizes the objective function and the
corresponding value of the objective function.
Module 1 Page 5
PROBLEMS:
C (12.5, 35)
D (0, 35)
B (25, 10)
F. R
O (0, 0) A (25, 0)
Module 1 Page 6
4. Solve the following LPP graphically:
Max Z = 100x1 + 40x2
Subject to the constraints
5x1 + 2x2 ≤ 1000;
3x1 + 2 x2 ≤ 900;
1x1 + 2x2 ≤ 500;
x1, x2 ≥ 0. [Ans: Infinitely many solutions]
5. Solve the following LPP graphically:
Max Z = 3x1 + 2x2
Subject to the constraints
x1 –x2 ≥1;
x1 + x2 ≥3;
x1, x2 ≥ 0. [Ans: Max Z occur at ∞, ∴ Unbounded solution]
6. Solve the following LPP graphically:
Max Z = x1 + x2
Subject to the constraints
x1 + x2 ≤ 1;
– 3x1 + x2 ≥3;
x1, x2 ≥ 0.
Ans: [No soln since there is no common shaded feasible region]
Module 1 Page 7
General LPP
In general an LPP can have any no. of decision variables and any no. of constraints. The general LPP
with n decision variables and m constraints takes the following form
Max or Min Z = c1x1+c2x2+…+cnxn
s. t .c
a11x1+a12x2+…+a1nxn ( ≤ , =, ≥) b1
a21x1+a22x2+…+a2nxn ( ≤ , =, ≥) b2
…………………………………….
am1x1+am2x2+….amnxn ( ≤ , =, ≥) bm
x1, x2,….xn ≥ 0
Standard form:-
The standard form of an LPP in n variables and m constraints can be represented as
Max or Min Z = c1x1+c2x2+…+cnxn
s.t .c
a11x1+a12x2+…+a1nxn = b1
a21x1+a22x2+…+a2nxn = b2
…………………………………….
am1x1+am2x2+….amnxn = bm
x1,x2,….xn ≥ 0,
b1,b2,…bm ≥ 0
Using matrix notation this system may be expressed as
Max or Min Z = CX
s.t.c AX=B
X ≥ 0; B ≥ 0 where C = [𝑐1 𝑐2 … 𝑐𝑛 ]
𝑥1 𝑎11 𝑎12 … 𝑎1𝑛
𝑥2
X = [ ⋮ ] ; A =[ 𝑎… 21 𝑎22 … 𝑎2𝑛 ]
… … …
𝑥𝑛 𝑎 𝑚1 𝑎 𝑚2 … 𝑎𝑚𝑛
𝑏1
𝑏2
B=[ ]
⋮
𝑏𝑚
Here X is called the decision vector, C is called profit vector or cost vector. B is called the
constant vector and A is called the coefficient matrix or matrix of technological coefficients or
constraint matrix. Here AX = B is called the constraint equation which is to be dealt with extensively.
The conditions X ≥ 0 and B ≥ 0 are separated as non negativity constraints.
Canonical form:-
Consider the LPP in the standard form
Max = c1x1+c2x2+…+cnxn ……………..(1)
Module 1 Page 8
s.t .c
a11x1+a12x2+…+a1nxn = b1
a21x1+a22x2+…+a2nxn = b2
………………………… …………(2)
am1x1+am2x2+….amn xn = bm
x1, x2,….xn ≥ 0 ……………………….(3)
Consider the system of m equations in n variables marked as (2) .When m < n, from the theory of
relations we see that n – m variables may be given arbitrary values and solve for the other m variables.
Now give the value zero for a set of n – m variables. Then solve for a set of n – m variables. Then solve
for the other m variables. Then we get a complete solution of the system of equations. These m
variables are called basic variables. The set of one such collection of basic variables is called a basis for
the system of equations. A solution of the system of equations (2) obtained like this is called a basic
solution of the LPP. We may get nCm no. of basic solutions. If all the variables in this basic solution
have non - negative values, then this becomes a feasible solution. Such solution is called a basic
feasible solution (BFS).
The constraint equations (2) can be brought to a convenient form known as canonical form which has
the following characteristics:
1. Each equation consists of exactly one basic variable ( with non – zero coefficients)
2. The coefficient of that basic variable is unity.
3. This basic variable does not occur in any other equation. ( in other words coefficient of this basic
variable in other equations are zeroes)
A system of equations may be brought to a canonical form by elementary row
transformations as seen in matrix solution of simultaneous equations. The sequence of such
transformations that reduces a given system into canonical form is called pivot operations.
Canonical form is the form in which each constraint has a basic variable.
Basic solution : -The solution obtained from a canonical system by setting the algebraic variables to
zero and solving for the basic variable is called a basic solution.
Slack variables :- If a constraint has a sign ‘≤ ’ then in order to make it an equality ,we have to add
some variables to the LHS .The variables which are added to the LHS of the constraints to convert them
into equalities are called slack variables.
Module 1 Page 9
Surplus variables:- If a constraint has a sign ‘≥ ’ then in order to make it an equality ,we have to
subtract some variables from the LHS .The variables which are subtracted from LHS of the constraints
to convert them into equalities are called surplus variables.
Steps in simplex method:-
1. Formulate the problem in to a mathematical equation.
2. Convert the constraints in to equalities by introducing the non negative slack variables or surplus
variables whichever necessary.
3. Construct initial simplex table.
4. Calculate all Zj – Cj and if all the values are ≥ 0 it is considered to be an optimal solution.
Otherwise go to the next step.
5. Find incoming and outgoing variables. The incoming variable corresponds to highest – ve in
Zj – Cj and outgoing variable corresponds to the minimum ratio.
𝑋
𝐵
[Ratio column : 𝑐𝑜𝑟𝑟𝑒𝑠𝑝𝑜𝑛𝑑𝑖𝑛𝑔 𝑒𝑙𝑒𝑚𝑒𝑛𝑡 ].
𝑖𝑛 𝑘𝑒𝑦 𝑐𝑜𝑙𝑢𝑚𝑛
6. Identify the row corresponds to the minimum ratio ,which is known as key row and intersecting
element of key row and key column is known as key element.
7. Now the corresponding variable of the key element enter in to the basis while the surplus
variable will leave from the basis.
8. Generate a new solution using the following steps
a) For key row, divide each element by key element.
b) For remaining rows, use the formula
New value = old value ± [value of the above or below key element in to corresponding value of new row].
Module 1 Page 10
Problems
Cj 7 5 0 0
Ratio=XB/x1
CB Basis XB x1 x2 S1 S2
0 S1 6 1 2 1 0 6
0 S2 12 4 3 0 1 3 →
Zj 0 0 0 0
Zj - Cj -7 ↑ -5 0 0
Cj 7 5 0 0
Ratio=XB/x1
CB Basis XB x1 x2 S1 S2
0 S1 3 0 5/4 1 -1/4
7 x1 3 1 3/4 0 1/4
Zj 7 21/4 0 7/4
Zj - Cj 0 1/4 0 7/4
Module 1 Page 11
𝑥1 , 𝑥2 , 𝑥3 ≥ 0
Convert the inequalities to equation by introducing slack variables S1,S2,S3
∴ LPP becomes
Max Z = 3𝑥1 + 5𝑥2 + 4𝑥3 + 0𝑆1 + 0𝑆2 + 0𝑆3
Subject to the constraints
2𝑥1 + 3𝑥2 + 0𝑥3 + 𝑆1 = 8
0𝑥1 + 2𝑥2 + 5𝑥3 + 𝑆2 = 10
3𝑥1 + 2𝑥2 + 4𝑥3 + 𝑆3 = 15
𝑥1 , 𝑥2 , 𝑥3 , 𝑆1, 𝑆2 , 𝑆3 ≥ 0
Cj 3 5 4 0 0 0
Ratio=XB/x2
CB Basis XB x1 x2 x3 𝑆1 𝑆2 S3
0 S1 8 2 3 0 1 0 0 8/3→
0 S2 10 0 2 5 0 1 0 5
0 S3 15 3 2 4 0 0 1 15/2
Zj 0 0 0 0 0 0
Zj - Cj -3 -5 -4 0 0 0
↑
Cj 3 5 4 0 0 0
Ratio=XB/x2
CB Basis XB x1 x2 x3 𝑆1 𝑆2 S3
5 x2 8/3 2/3 1 0 1/3 0 0 -
0 S2 14/3 -4/3 0 5 -2/3 1 0 14/15→
0 S3 29/3 5/3 0 4 -2/3 0 1 29/12
Zj 10/3 5 0 5/3 0 0
Zj - Cj 1/3 0 -4 5/3 0 0
↑
Cj 3 5 4 0 0 0
Ratio=XB/x1
CB Basis XB x1 x2 x3 𝑆1 𝑆2 S3
5 x2 8/3 2/3 1 0 1/3 0 0 4
4 x3 14/15 -4/15 0 1 -2/15 1/5 0 -
0 S3 89/15 41/15 0 0 -2/15 -4/5 1 89/41→
Zj 34/15 5 4 17/15 4/5 0
Zj - Cj -11/15 0 0 17/15 4/5 0
↑
Module 1 Page 12
Cj 3 5 4 0 0 0
Ratio=XB/x1
CB Basis XB x1 x2 x3 𝑆1 𝑆2 S3
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
Zj 3 5 4 45/41 24/41 11/41
Zj - Cj 0 0 0 45/41 24/41 11/41
Note:- A minimization problem can be converted into a maximization problem by changing the sign of
coefficients in the objective function.
Module 1 Page 13
S2 leaves and x2 enters.
Cj -1 3 -2 0 0 0
Ratio=XB/x2
CB Basis XB x1 x2 x3 𝑆1 𝑆2 S3
0 S1 10 5/2 0 3 1 1/4 0 4→
3 x2 3 -1/2 1 0 0 1/4 0 -
0 S3 1 -5/2 0 8 0 -3/4 1 -
Zj -3/2 3 0 0 3/4 0
Zj - Cj -1/2 0 2 0 3/4 0
↑
Cj -1 3 -2 0 0 0
Ratio=XB/x2
CB Basis XB x1 x2 x3 𝑆1 𝑆2 S3
-1 x1 4 1 0 6/5 2/5 1/10 0
3 x2 5 0 1 3/5 1/5 3/10 0
0 S3 11 0 0 11 1 -1/2 1
Zj -1 3 3/5 1/5 4/5 0
Zj - Cj 0 0 13/5 1/5 4/5 0
Module 1 Page 14
Big M Method
While using simplex method, if one or more constraints of the ≥ type or = type, then introduction of
surplus variables does not give a ready BFS. In such cases we can apply another technique. Consider M
as a very large positive quantity compared to other values in the problem. First convert the problem into
the standard form by introducing slack or surplus variables. Then with each equation, corresponding to ≥
type or = type in original constraints, introduce an additional variable known as artificial variable. Then
modify the objective function as follows: For a maximization problem take a new objective function
which is equal to Z – M∑ 𝐴𝑖 . Then optimize by simplex method. Then it is evident that the optimal basis
will not contain artificial variables. Value of each artificial variable will be zero. Hence we will get the
optimal solution of the original problem.
Steps:
PROBLEMS
Module 1 Page 15
∴ LPP becomes
Max Z’ = −5𝑥1 − 6𝑥2 + 0𝑆1 + 0𝑆2
Subject to the constraints
2𝑥1 + 5𝑥2 − 𝑆1 = 1500
3𝑥1 + 𝑥2 − 𝑆2 = 1200
𝑥1 , 𝑥2, 𝑆1, 𝑆2 ≥ 0
Since there are two ≥ type inequalities, we introduce artificial variables A1 & A2.
∴ LPP becomes
Max Z’ = −5𝑥1 − 6𝑥2 + 0𝑆1 + 0𝑆2 − 𝑀𝐴1 − 𝑀𝐴2
Subject to the constraints
2𝑥1 + 5𝑥2 − 𝑆1 + 𝐴1 = 1500
3𝑥1 + 𝑥2 − 𝑆2 + 𝐴2 = 1200
𝑥1 , 𝑥2, 𝑆1, 𝑆2 ≥ 0
Cj –5 –6 0 0 –M –M
Ratio=XB/x1
CB Basis XB x1 x2 S1 S2 A1 A2
–M A1 1500 2 5 –1 0 1 0 300→
–M A2 1200 3 1 0 –1 0 1 1200
Zj – 5M – 6M M M –M –M
Zj - Cj – 5M + 5 – 6M + 6 M M 0 0
↑
A1 leaves and x2 enters.
Cj –5 –6 0 0 –M
Ratio=XB/x1
CB Basis XB x1 x2 S1 S2 A2
–6 x2 300 2/5 1 -1/5 0 0 7500
–M A2 900 13/5 0 1/5 -1 1 4500/13→
−12 − 13𝑀 –6 −6 − 𝑀 M –M
Zj 5 5
13 − 13𝑀 0 6−𝑀 M 0
Zj - Cj 5 5
↑
A2 leaves and x1 enters.
Cj –5 –6 0 0
Ratio=XB/x1
CB Basis XB x1 x2 S1 S2
–6 x2 2100 0 1 −3 2
13 13 13
–5 x1 4500 1 0 1 −5
13 13 13
Zj –5 –6 1 1
Zj - Cj 0 0 1 1
All Zj – Cj ≥ 0, so optimum solution is obtained.
Z’ max = – 2700 at x1 = 2100
13
, x2= 4500
13
.
Module 1 Page 16
2. Using big M method solve the following LPP:
Min Z = 3𝑥1 + 8𝑥2
Subject to the constraints
𝑥1 + 𝑥2 = 200
𝑥1 ≤ 80
𝑥2 ≥ 60
𝑥1 , 𝑥2 ≥ 0
Change the minimization problem to maximization and convert the inequalities to equation by
introducing surplus variables S1 & S2
∴ LPP becomes
Max Z’ = −3𝑥1 − 8𝑥2 + 0𝑆1 + 0𝑆2
Subject to the constraints
𝑥1 + 𝑥2 = 200
𝑥1 + 𝑆1 = 80
𝑥2 − 𝑆2 = 60
𝑥1 , 𝑥2, 𝑆1, 𝑆2 ≥ 0
Since there is an equality & one ≥ type inequality, we introduce artificial variables A1 & A2.
∴ LPP becomes
Max Z’ = −3𝑥1 − 8𝑥2 + 0𝑆1 + 0𝑆2 − 𝑀𝐴1 − 𝑀𝐴2
Subject to the constraints
𝑥1 + 𝑥2 + 𝐴1 = 200
𝑥1 + 𝑆1 = 80
𝑥2 − 𝑆2 + 𝐴2 = 60
𝑥1 , 𝑥2, 𝑆1, 𝑆2 ≥ 0
Cj -3 -8 0 0 –M –M
Ratio=XB/x2
CB Basis XB x1 x2 S1 S2 A1 A2
–M A1 200 1 1 0 0 1 0 200
0 𝑆1 80 1 0 1 0 0 0 -
– M 𝑨𝟐 60 0 1 0 -1 0 1 60→
Zj –M – 2M 0 M –M –M
Zj - Cj –M + 3 – 2M + 8 0 M 0 0
↑
A2 leaves and x2 enters.
Cj -3 -8 0 0 –M
Ratio=XB/x1
CB Basis XB x1 x2 S1 S2 A1
–M A1 140 1 0 0 1 1 140
0 𝑺𝟏 80 1 0 1 0 0 80→
–8 𝑥2 60 0 1 0 -1 0 -
Zj –M –8 0 – M +8 –M
Zj - Cj –M + 3 0 0 – M +8 0
↑
Module 1 Page 17
S1 leaves and x1 enters.
Cj -3 -8 0 0 –M
Ratio=XB/S2
CB Basis XB x1 x2 S1 S2 A1
–M A1 60 0 0 -1 1 1 60
–3 𝑥1 80 1 0 1 0 0 -
–8 𝑥2 60 0 1 0 -1 0 -
Zj –3 –8 M –3 – M +8 –M
Zj - Cj 0 0 M –3 – M +8 0
A1leaves and S2 enters.
Cj -3 -8 0 0
Ratio=XB/S2
CB Basis XB x1 x2 S1 S2
0 S2 60 1 0 -1 1
–3 𝑥1 80 1 0 1 0
–8 𝑥2 120 0 1 -1 0
Zj –3 –8 5 0
Zj - Cj 0 0 5 0
Module 1 Page 18
Initial basic feasible solution is S1 = 2, A1 =12
Cj 3 2 0 0 –M
Ratio=XB/x2
CB Basis XB x1 x2 S1 S2 A1
0 S1 2 2 1 1 0 0 2→
–M A1 12 3 4 0 -1 1 3
Zj – 3M – 4M 0 M –M
Zj - Cj – 3M - 3 – 4M - 2 0 M 0
↑
Cj 3 2 0 0 –M
Ratio=XB/x2
CB Basis XB x1 x2 S1 S2 A1
2 x2 2 2 1 1 0 0
–M A1 4 -5 0 -4 -1 1
Zj 4+5M 2 2+4M M –M
Zj - Cj 5M+1 0 2+4M M 0
Here all Zj – Cj ≥ 0 and an artificial variable appears in the basis at the positive level.
∴ The given LPP does not possess any feasible solution. But the LPP possesses a pseudo optimal
solution.
4. Using big M method solve the following LPP:
Max Z = 40000𝑥1 + 55000𝑥2
Subject to the constraints
1000𝑥1 + 1500𝑥2 ≤ 20000
𝑥1 ≤ 12
𝑥2 ≥ 5
𝑥1 , 𝑥2 ≥ 0 [ Ans:- Z Max = 2320000/3 at x1= 12, x2 =16/3]
Module 1 Page 19
Two Phase Method:-
The LP problems, where artificial variables are introduced can also be solved by a modified simplex
method known as two phase method. In this method we get the solution in two phases. In the first phase,
the simplex method is applied to a specially constructed LPP called auxiliary LPP. In the first phase, we
get BFS. The second phase leads from the BFS obtained in the first phase to an optimum BFS.
Note:-
a. All problems of minimizations are to be converted to maximization.
b. In the first phase -1 is the coefficient of the artificial variable and 0 is of all other variables.
c. Simplex table obtained in phase 1 is used in Phase 2. In phase 2 there is no artificial variable.
Steps:
Phase 1:-
In this phase, we construct an auxiliary LPP leading to a final simplex table containing a
BFS to the original problem.
a) Assign a cost -1 to each artificial variable and a cost 0 to all other variables and get a new
objective function Z* = –A1–A2–A3… where Ai’s are artificial variables.
b) Write down the auxiliary LPP in which the new objective function is to be maximized
subject to the given set of constraints.
c) Solve the auxiliary LPP by simplex method until any of the following 3 cases arise.
(i) Max Z* <0 and at least one artificial variable appears in the optimum basis at
positive level.
(ii) Max Z* = 0 and at least one artificial variable appears in the optimum basis at
zero level.
(iii) Max Z* = 0 and no artificial variable appears in the optimum basis.
In case (i), given LPP does not possess any feasible solution, whereas in case
(ii) & (iii) we go to phase II.
Phase 2:-
Use the optimum BFS of phase 1 as a starting solution for the original LPP. Assign the
actual costs to the variable in the objective function and a zero cost to every artificial variable in
the basis at zero level. Delete the artificial variable column from the table which is eliminated
from the basis in phase 1.Apply simplex method to the modified simplex table obtained at the
end of phase1till an optimum basic feasible solution is obtained or till there is an indication of
unbounded solution.
Module 1 Page 20
1. Use two phase method to solve
Max Z = 5𝑥1 + 3𝑥2
Subject to the constraints
2x1+x2 ≤ 1
x1+4x2 ≥ 6
x1,x2 ≥ 0
Phase 1
Max Z = 0𝑥1 + 0𝑥2 + 0𝑆1 + 0𝑆2 − 𝐴1
Subject to the constraints
2x1+x2+S1 = 1
x1+4x2 m –S2+A1 = 6
x1,x2 ≥ 0
Initial basic feasible solution is S1 = 1, A1 =6
Cj 0 0 0 0 –1
Ratio=XB/x2
CB Basis XB x1 x2 S1 S2 A1
0 S1 1 2 1 1 0 0 1→
–1 A1 6 1 4 0 -1 1 6/4
Zj –1 –4 0 1 –1
Zj - Cj –1 –4 0 1 0
↑
Cj 0 0 0 0 –1
Ratio=XB/x2
CB Basis XB x1 x2 S1 S2 A1
0 x2 1 2 1 1 0 0
–1 A1 2 -7 0 -4 -1 1
Zj 7 0 4 1 1
Zj - Cj 7 0 4 1 1
Here all Zj-Cj≥0, so the current BFS is optimal. Since Max Z * < 0 and an artificial variable A1
appears in the basis at positive level. So the original LPP does not possess any feasible solution.
Phase 1
Module 1 Page 21
Max Z = 0𝑥1 + 0𝑥2 + 0𝑥3 + 0𝑆1 + 0𝑆2 − 𝐴1
Subject to the constraints
2x1 + x2 −6x3+A1 = 20
6x1 + 5x2+10 x3 +S1= 76
8x1 − 3x2+6 x3 +S2 = 50
x1,x2, x3 ≥ 0
Initial basic feasible solution is A1 =20 ,S1 = 76, S2 = 50.
Cj 0 0 0 –1 0 0
Ratio=XB/x1
CB Basis XB x1 x2 x3 A1 S1 S2
–1 A1 20 2 1 –6 1 0 0 10
0 S1 76 6 5 10 0 1 0 12.6
0 S2 50 8 –3 6 0 0 1 6.2→
Zj –2 –1 6 –1 0 0
Zj - Cj –2 –1 6 0 0 0
↑
S2 leaves and x1 enters.
Cj 0 0 0 –1 0 0
Ratio=XB/x2
CB Basis XB x1 x2 x3 A1 S1 S2
–1 A1 15/2 0 7/4 -15/2 1 0 -1/4 30/7→
0 S1 77/2 0 29/4 11/2 0 1 -3/4 154/29
0 x1 25/4 1 -3/8 3/4 0 0 1/8
Zj 0 – 7/4 15/2 – 1 0 1/4
Zj - Cj 0 – 7/4 15/2 0 0 1/4
↑
A1 leaves and x2 enters
Cj 0 0 0 0 0
Ratio=XB/x2
CB Basis XB x1 x2 x3 S1 S2
–1 x2 30/7 0 1 -30/7 0 -1/7
0 S1 52/7 0 0 256/7 1 2/7
0 x1 55/7 1 0 -6/7 0 1/14
Zj 0 0 0 0 0
Zj - Cj 0 0 0 0 0
Here all Zj-Cj≥0, so the optimum solution to the auxiliary LPP has been obtained. Also
Max Z * = 0 with no artificial variable in the basis. So go to phase 2.
Phase 2:-
Cj 5 –4 3 0 0
Ratio=XB/x2
CB Basis XB x1 x2 x3 S1 S2
–4 x2 30/7 0 1 -30/7 0 -1/7
0 S1 52/7 0 0 256/7 1 2/7
5 x1 55/7 1 0 -6/7 0 1/14
Zj 5 –4 90/7 0 13/14
Zj - Cj 0 0 69/7 0 13/14
Module 1 Page 23
Methods to resolve degeneracy:-
Steps:-
1. First find out the rows for the minimum non negative ratio is the same(tie).Suppose there is a tie
between first and third row.
2. Now rearrange the columns of the usual simplex table so that the columns forming the original
unit matrix come first in proper order.
𝐸𝑙𝑒𝑚𝑒𝑛𝑡𝑠 𝑜𝑓 𝑡ℎ𝑒 𝑓𝑖𝑟𝑠𝑡 𝑐𝑜𝑙𝑢𝑚𝑛 𝑜𝑓 𝑡ℎ𝑒 𝑢𝑛𝑖𝑡 𝑚𝑎𝑡𝑟𝑖𝑥
3. Find the minimum of the ratio, ( )
𝐶𝑜𝑟𝑟𝑒𝑠𝑝𝑜𝑛𝑑𝑖𝑛𝑔 𝑒𝑙𝑒𝑚𝑒𝑛𝑡𝑠 𝑜𝑓 𝑘𝑒𝑦 𝑐𝑜𝑙𝑢𝑚𝑛
only for the tied rows.ie, for the first and third rows.
a) If the third row has the minimum ratio then this row will be the key row and the
key element can be determined by intersecting the key row with key column.
b) If this minimum is also not unique then go to next step.
4. Now find the minimum of the ratio only for the tied rows. If this minimum ratio is unique for the
first row, then this row will be the key row for determining the key element by intersecting with
𝐸𝑙𝑒𝑚𝑒𝑛𝑡𝑠 𝑜𝑓 𝑡ℎ𝑒 𝑠𝑒𝑐𝑜𝑛𝑑 𝑐𝑜𝑙𝑢𝑚𝑛 𝑜𝑓 𝑡ℎ𝑒 𝑢𝑛𝑖𝑡 𝑚𝑎𝑡𝑟𝑖𝑥
key column. ( ).
𝐶𝑜𝑟𝑟𝑒𝑠𝑝𝑜𝑛𝑑𝑖𝑛𝑔 𝑒𝑙𝑒𝑚𝑒𝑛𝑡𝑠 𝑜𝑓 𝑘𝑒𝑦 𝑐𝑜𝑙𝑢𝑚𝑛
If this minimum is not unique , then go to next step.
5. Find the minimum of the ratio. The above step is repeated till the minimum ratio is obtained so
as to resolve the degeneracy. After the resolution of this tie, simplex method is applied to obtain
the optimum solution
𝐸𝑙𝑒𝑚𝑒𝑛𝑡𝑠 𝑜𝑓 𝑡ℎ𝑒 𝑡ℎ𝑖𝑟𝑑 𝑐𝑜𝑙𝑢𝑚𝑛 𝑜𝑓 𝑡ℎ𝑒 𝑢𝑛𝑖𝑡 𝑚𝑎𝑡𝑟𝑖𝑥
( ).
𝐶𝑜𝑟𝑟𝑒𝑠𝑝𝑜𝑛𝑑𝑖𝑛𝑔 𝑒𝑙𝑒𝑚𝑒𝑛𝑡𝑠 𝑜𝑓 𝑘𝑒𝑦 𝑐𝑜𝑙𝑢𝑚𝑛
Problems:-
1. Solve Max Z = 3𝑥1 + 9𝑥2
Subject to the constraints
𝑥1 + 4𝑥2 ≤ 8
𝑥1 + 2𝑥2 ≤ 4
x1,x2 ≥ 0
Convert the inequalities to equation by introducing slack variables S1&S2
∴ LPP becomes
Max Z = 3𝑥1 + 9𝑥2 + 0𝑆1 + 0𝑆2
Subject to the constraints
𝑥1 + 4𝑥2 + 𝑆1 = 8
𝑥1 + 2𝑥2 + 𝑆2 = 4
𝑥1 , 𝑥2, 𝑆1, 𝑆2 ≥0
Initial basic feasible solution is S1 = 6, S2 =12
Cj 3 9 0 0
Ratio=XB/x1
CB Basis XB x1 x2 S1 S2
0 S1 8 1 4 1 0 2
0 S2 4 1 2 0 1 2 𝑡𝑖𝑒
Zj 0 0 0 0
Zj - Cj -3 -9 0 0
↑
Module 1 Page 24
This is the indication of the existence of degeneracy in the given LPP. Rearrange the columns of the
simplex table that the initial identity matrix appears first.
Cj 0 0 3 9
Ratio=S1/x2
CB Basis XB S1 S 2 x1 x2
0 S1 8 1 0 1 4 1/4
0 S2 4 0 1 1 2 0→
Zj 0 0 0 0
Zj - Cj 0 0 -3 -9
↑
Cj 0 0 3 9
Ratio=S1/x2
CB Basis XB S1 S2 x1 x2
0 S1 0 1 -2 -1 0
9 x2 2 0 1/2 1/2 1
Zj 0 9/2 9/2 9
Zj - 0 9/2 3/2 0
Cj
2. Solve
Max Z = 2𝑥1 + 𝑥2
Subject to the constraints
4𝑥1 + 3𝑥2 ≤ 12
4𝑥1 + 𝑥2 ≤ 8
4𝑥1 − 𝑥2 ≤ 8
x1,x2 ≥ 0 [Z max = 5 at x1= 3/2, x2= 5.]
Module 1 Page 25