Unit 1A
Unit 1A
Introduction
General Linear Programming Problem
The linear programming involving more than two variables may be expressed as follows :
Maximize (or) Minimize Z = c1 x 1 + c 2 x 2 + c 3 x 3 + K c n x n
Subject to the constraints
a11 x 1 + a12 x 2 + ........ + a1 n x n £ or = or ³ b1
a 21 x 1 + a 22 x 2 + ........ + a 2n x n £ or = or £ b2
a 31 x 1 + a 32 x 2 + ........ + a 3n x n £ or = or £ b3
..........................................................................
..........................................................................
a m1 x 1 + a m 2 x 2 + ........ + a mn x n £ or = or ³ bm
and the non-negativity restrictions
x 1 , x 2 , x 3 , ... x n ³ 0.
Note : Some of the constraints may be equalities, some others may be inequalities or (£)
type and remaining one inequalities of ( ³) type or all of them are of same type.
Definition (1) : A set of values x 1 , x 2 ..... x n which satisfies the constraints of the LPP is
called its solution.
Definition (2) : Any solution to a LPP which satisfies the non-negativity restrictions of
the LPP is called its feasible solution.
Definition (3) : Any feasible solution which optimizes (maximizes or minimizes) the
objective function of the LPP is called its optimum solution or optimal solution.
30
are called slack variables. The value of these variables can be interpreted as the amount of
unused resource.
Definition (5) : If the constraints of a general LPP be
n
S a ij x j ³ bi (i = k, k + 1 K ) ...(1)
j=1
then the non-negative variables s i which are introduced to convert the inequalities (1) to the
equalities
n
S a ij x j - s i = bi (i = k, k + 1 K )
j=1
are called surplus variables. The value of these variables can be interpreted as the amount
over and above the required level.
Canonical and Standard Forms of LPP
After the formulation of LPP, the next step is to obtain its solution. But before any
method is used to find its solution, the problem must be presented in suitable from. Two forms
are dealt with here, the canonical form and the standard form.
The Canonical form : The general linear programming problem can always be
expressed in the following form :
Maximize Z = c1 x 1 + c 2 x 2 + c 3 x 3 + .... + c n x n
subject to the constraints
a11 x 1 + a12 x 2 + ... + a1 n x n £ b1
a 21 x 1 + a 22 x 2 + ... + a 2n x n £ b2
.....................................................
.....................................................
a m1 x 1 + a m 2 x 2 + ... + a mn x n £ bm
and the non-negativity restrictions
x 1 , x 2 , ......, x n ³ 0.
This form of LPP is called the canonical form of the LPP.
In matrix notation the canonical form of LPP can be expressed as :
Maximize Z = CX (objective function)
subject to AX £ b (constraints)
and X ³ 0 (non-negativity restrictions)
31
when C = ( c1 , c 2 ......... c n ),
æ x1 ö æ b1 ö
æ a11 a12 K K K a1 n ö ç ÷ ç ÷
ç ÷ çx2 ÷ ç b2 ÷
ç a12 a 22 K K K a 2n ÷ ç. ÷ ç. ÷
A = ç ... .................. ... ÷, X = ç ÷, b = ç ÷
ç ÷ ç. ÷ ç. ÷
ç ... .................. ... ÷ ç. ÷ ç. ÷
ça a K K K a ÷ ç ÷ ç ÷
è m1 m 2 mn ø çx ÷ çb ÷
è nø è nø
Characteristics of the Canonical Form :
(i) The objective function is of maximization type.
(ii) All constraints are of ( £) type.
(iii) All variables x i are non-negative.
The Standard Form :
The general linear programming problem in the form
Maximize Z = c1 x 1 + c 2 x 2 + K + c n x n
subject to the constraints
a11 x 1 + a12 x 2 + ... + a1 n x n = b1
a 21 x 1 + a 22 x 2 + ... + a 2n x n = b2
......................................................
......................................................
a m1 x 1 + a m 2 x 2 + ... + a mn x n = bm
and x 1 , x 2 , ...... , x n ³ 0 is known as standard form.
In matrix notation the standard form of LPP can be expressed as :
Maximize Z = CX (objective function)
subject to constraints
AX = b and X ³ 0
Characteristics of the Standard Form :
(i) The objective function is of maximization type.
(ii) All constraints are expressed as equations.
(iii) Right hand side of each constraint is non-negative.
(iv) All variables are non-negative.
Note :
(1) : The minimization of a function f ( x) is equivalent to the maximization of the
negative expression of this function.
i. e., Min f ( x) = - Max {- f ( x)}
i. e., Min Z = - Max ( - Z)
e. g : Min Z = c1 x 1 + c 2 x 2 is equivalent to
Max ( - Z) = - c1 x 1 - c 2 x 2
(2) : An inequality in one direction can be converted into an in equality in the opposite
direction by multiplying both sides by ( - 1).
32
e. g : ax 1 + bx 2 ³ c
Þ - ax 1 - bx 2 £ - c
(3) : An equality constraint can be expressed as two inequalities.
ax 1 + bx 2 £ cü ax 1 + bx 2 £ c
e. g : ax 1 + bx 2 = c Þ ý Þ
ax 1 + bx 2 ³ cþ - ax 1 - bx 2 £ - c
(4) : An inquality constraint with its left hand side in the absolute from can be expressed
as two inequalities.
ax 1 + bx 2 £ c
e. g : |ax 1 + bx 1| £ c Þ
- ax 1 - bx 2 £ - c
(5) : If a variable is unconstrained or unrestricted (without specifying its sign), it can
always be expressed as the difference of two non-negative variables.
e. g. : If x 2 is unrestricted, then
x 2 = x 2¢ - x 2¢ ¢ where x 2 ¢ , x 2 ¢ ¢ ³ 0.
(6) : Whenever slack /surplus variables are introduced in the constraints, they should
also appear in the objective function with zero coefficients.
* Example 1 : Express the following LPP in the canonical form.
Maximize Z = 2 x 1 + 3 x 2 + x 3
subject to the constraints
4 x1 - 3 x 2 + x 3 £ 6
x1 + 5 x 2 - 7 x 3 ³ - 4
and x 1 , x 3 ³ 0, x 2 is unrestricted
Solution : As x 2 is unrestricted, x 2 = x 2 ¢ - x 2 ¢ ¢
where x 2 ¢ , x 2 ¢ ¢ ³ 0 \ The given LPP becomes
Maximize Z = 2x 1 + 3 ( x 2 ¢ - x 2 ¢ ¢ ) + x 3
Subject to 4 x 1 - 3x 2 ¢ + 3x 2 ¢ ¢ + x 3 £ 6
x 1 + 5x 2 ¢ - 5x 2 ¢ ¢ - 7 x 3 ³ - 4
x 1 , x 2 ¢ , x 2 ¢ ¢ , x 3 ³ 0.
Convert the second constraint £ type by multiplying both sides by - 1.
Now the LPP becomes
Maximize Z = 2x 1 + 3x 2 ¢ - 3x 2 ¢ ¢ + x 3
subject to 4 x 1 - 3x 2 ¢ + 3x 2 ¢ ¢ + x 3 £ 6
-x 1 - 5x 2 ¢ + 5x 2 ¢ ¢ + 7 x 3 £ 4
and x 1 , x 2 ¢ , x 2 ¢ ¢ , x 3 ³ 0.
which is in the canonical form.
* Example 2 : Express the following LPP in standard form
Minimize Z = 5 x 1 + 7 x 2
subject to constraints x1 + x 2 £ 8
33
3 x1 + 4 x 2 ³ 3
6 x1 + 7 x 2 ³ 5 and x 1 , x 2 ³ 0.
Solution : Since Min Z = -Max ( -Z) = - Max Z * ,
The given LPP becomes maximize Z * = - 5x 1 - 7 x 2
subject to x1 + x 2 £ 8
3x 1 + 4 x 2 ³ 3
6 x 1 + 7 x 2 ³ 5 and x 1 , x 2 ³ 0.
By introducing slack variable s 1 and surplus variables s 2 , s 3 the standard from of the
LPP is given by
Maximize Z * = - 5x 1 - 7 x 1 + 0 s 1 + 0 s 2 + 0 s 3
subject to x 1 + x 2 + s1 = 8
3x 1 + 4 x 2 - s 2 = 3
6x1 + 7x 2 - s 3 = 5
and x 1 , x 2 , s 1 , s 2 , s 3 ³ 0.
* Example 3 : Express the following LPP in standard (Matrix) from
Maximize Z = 4 x 1 + 2 x 2 + 6 x 3
subject to 2 x1 + 3 x 2 + 2 x 3 ³ 6
3 x1 + 4 x 2 = 8
6 x 1 - 4 x 2 + x 3 £ 10 and x 1 , x 2 , x 3 ³ 0.
Solution : By introducing the surplus variable s 1 and slack variable s 2 , the standard
from of the LPP becomes
Maximize Z = 4 x 1 + 2x 2 + 6 x 3 + 0 s 1 + 0 s 2
subject to 2x 1 + 3x 2 + 2x 3 - s 1 + 0 s 2 = 6
3x 1 + 4 x 2 + 0 x 3 + 0 s 1 + 0 s 2 = 8
6 x 1 - 4 x 2 + x 3 + 0 s 1 + s 2 = 10
and x 1 , x 2 , x 3 , s 1 , s 2 ³ 0.
Thus the given problem in matrix from is
Maximize Z = CX
subject to AX = b
X ³ 0
where C = ( 4, 2, 6, 0, 0)
æ x1 ö
ç ÷
æ 2 3 2 -1 0ö æ6 ö çx2 ÷
ç ÷ ç ÷
A = ç3 4 0 0 0÷ , b = ç 8 ÷ , X = çx3 ÷
ç ÷
ç 6 -4 1 0 1 ÷ø ç 10 ÷ ç s1 ÷
è è ø
çs ÷
è 2ø
34
From the table, we see that, the first two solutions are non-degenerate basic feasible
solutions and the third is non-degenerate and infeasible. The first solution is the optimal one.
\ The optimal solution is
Maximize Z = 5, x 1 = 2, x 2 = 1, x 3 = 0.
* Example 5 : obtain all the basic solutions to the following system of linear
equations :
2 x1 + 6 x 2 + 2 x 3 + x 4 = 3
6 x1 + 4 x 2 + 4 x 3 + 6 x 4 = 2
Which of them are basic feasible solutions and which are non-degenerate basic
solutions ? Is the non-degenerate solution feasible ?
Solution : Since there are 4 variables with 2 equations, we shall have 4C 2 = 6 different
basic solutions, which are given in the following table.
S. Basic Non-basic Values of the basic Is the Is the Is the solution
No. vari- variables variables given by the solution solution feasible and
ables constraint equations feasible ? non- non-dege-
degenerate ? nerate ?
2x 1 + 6 x 2 = 3 ü
ý
6 x 1 + 4 x 3 = 2þ
1 x1 , x 2 x3 = x4 = 0 Yes No No
1
Þ x 1 = 0, x 2 =
2
2x 1 + 2x 3 = 3 ü
ý
6 x 1 + 4 x 3 = 2þ
2 x1 , x 3 x2 = x4 = 0 No Yes No
7
Þ x 1 = - 2, x 3 =
2
36
2x 1 + x 4 = 3 ü
ý
6 x 1 + 6 x 4 = 2þ
3 x1 , x 4 x1 = x 3 = 0 No Yes No
8 7
Þ x1 = , x 2 = -
3 3
6 x 2 + 2x 4 = 3 ü
ý
4 x 2 + 4 x 4 = 2þ
4 x 2, x 3 x1 = x 4 = 0 Yes No No
1
Þ x2 = , x3 = 0
2
6 x 2 + x 4 = 3ü
ý
4 x 2 + 6 x 4 = 2þ
5 x 2, x 4 x1 = x 3 = 0 Yes No No
1
Þ x1 = , x 4 = 0
2
2x 3 + x 4 = 3ü
ý
6 x 3, x 4 x1 = x 2 = 0 4 x 3 + 6 x 4 = 2þ No Yes No
Þ x 3 = 2, x 4 = - 1
is called the evaluation corresponding to a j and the number ( Z j - C j ) is called the net
evaluation corresponding to a j .
37
Remark 1 : If ( Z j - C j ) =0 for atleast one j for which a ij > 0 i = 1, 2, ....., m; then another
basic feasible solution is obtained which gives an unchanged value of the objective function.
Remark 2 : (Unbounded solution). Let there exist a basic feasible solution to a given
LPP. If for atleast one j, for which a ij £ 0 ( i = 1, 2, ..., m) and ( Z j - C j ) is negative, then there
does not exist any optimum solution to this LPP.
Remark 3 : A necessary and sufficient condition for a basic feasible solution to a LPP to
be an optimum (maximum) is that ( Z j - C j ) ³ 0 for all j, for which a j Ï B.
Remark 4 : The two fundamental conditions on which the simplex method is based are :
(i) Feasibility condition : It ensures that if the initial (Starting) solution is basic feasible then
during computation only basic feasible solutions will be obtained. (ii) Optimality condition :
It guarantees that only improved solutions will be obtained.
The Simplex Algorithm
Assuming the existence of an initial basic feasible solution, an optimal solution to any
LPP by simplex method is found as follows :
Step 1 : Check whether the objective function is to be maximized for minimized. If it is to
be minimized, then covert it into a problem of maximization, by
Minimize Z = - Maximize (- Z)
Step 2 : Check whether all bi 's are positive. If any of the bi 's is negative, multiply both
sides of that constraint by - 1 so as to make its right hand side positive.
Step 3 : By introducing slack l surplus variables, convert the inequality constraints into
equations and express the given LPP into its standard form.
Step 4 : Find an initial basic feasible solution and express the above information
conveniently in the following simple table.
Cj (C1 C2 C 3 .....0 0 0 .....)
CB YB XB x1 x2 x 3 ..... s1 s2 s3 .....
C B1 s1 b1 a11 a12 a13 .....1 0 0 .....
C B2 s2 b2 a 21 a 22 a 23 .....0 1 0 .....
C B3 s3 b3 a 31 a 32 a 33 .....0 0 1 .....
: : : : : : ..... .....
: : : : : : ..... .....
: : : : : : ..... .....
: : : : : : ..... .....
: : : body matrix unit matrix
(Z j - C j ) Z0 Z1 - C 1 Z 2 - C 2 ... ... ... .........................
(Where C j - row denotes the coefficients of the variables in the objective function.
C B -column denotes the coefficients of the basic variables in the objective function. YB - column
denotes the basic variables. X B -column denotes the values of the basic variables. The
38
coefficients of the non-basic variables in the constraint equations constitute the body matrix
while the coefficients of the basic variables constitute the unit matrix. The row (Z j - C j )
denotes the net evaluations (or) index for each column).
Step 5 : Compute the net evaluations ( Z j - C j ) ( j = 1, 2, K n) by using the relation
Z j - C j = CB aj - C j.
Examine the sign of Z j - C j
(a) If all ( Z j - C j ) ³ 0 then the current basic feasible solution X B is optimal.
(b) If atleast one ( Z j - C j ) < 0, then the current basic feasible solution is not optimal,
go to the next step.
Step 6 : (To find the entering variable)
The entering variable is the non-basic variable corresponding to the most negative value
of ( Z j - C j ). Let it be x r for some j = r. The entering variable column is known as the key
column (or) pivot column which shown marked with an arrow at the bottom. If more than one
variable the same most negative ( Z j - C j ), any of these variables may be selected arbitrarily as
the entering variable.
Step 7: (To find the leaving variable)
ì X Bi ü
Compute the ratio q = Min í , a ir > 0 ý (i. e., the ratio between the solution column
î a ir þ
and the entering variable column by considering only the positive denominators)
(a) If all a ir £ 0, then there is an unbounded solution to the given LPP.
(b) If atleast one a ir > 0, then the leaving variable is the basic variable corresponding
X Bk
to the minimum ratio q. If q = , then the basic variable x k leaves the basis. The
a kr
leaving variable row is called the key row or pivot row (or) pivot equation,and
the element at the intersection of the pivot column and pivot row is called the pivot
element or key element (or) leading element.
Step 8 : Drop the leaving variable and introduce the entering variable along with its
associated value under C B column. Convert the pivot element to unity by dividing the pivot
equation by the pivot element and all other elements in its column to zero by making use of
(i) New pivot equation = old pivot equation ¸ pivot element.
(ii) New equation (all other row including ( Z j - C j ) row)
æ Corresponding ö
ç ÷ æ New pivot ö
= Old equation - ç Column ÷ ´ çç ÷÷
ç coefficient ÷ è equation ø
è ø
Step 9 : Go to step (5) and repeat the procedure until either an optimum solution is
obtained or there is an indication of an unbounded solution.
Note (1) : For maximization problems. :
(i) If all ( Z j - C j ) ³ 0, then the current basic feasible solution is optimal.
(ii) If atleast one ( Z j - C j ) < 0, then the current basic feasible solution is not optimal.
39
(iii) The entering variable is the non-basic variable corresponding to the most negative
value of ( Z j - C j ).
Note (2) : For minimization problems :
(i) If all ( Z j - C j ) £ 0, then the current basic feasible solution is optimal.
(ii) If atleast one ( Z j - C j ) > 0 , then the current basic feasible solution is not optimal.
(iii) The entering variable is the non-basic variable corresponding to the most positive
value of ( Z j - C j ) .
Note (3) : For both maximization and minimization problems, the leaving variable is the
basic variable corresponding to the minimum ratio q.
* Example 6 : Use simplex method to solve the LPP
Maximize Z = 4 x 1 + 10 x 2
subject to 2 x 1 + x 2 £ 50
2 x 1 + 5 x 2 £ 100
2 x 1 + 3 x 2 £ 90 and x 1 , x 2 ³ 0.
Solution : By introducing the slack variables s 1 , s 2 and s 3 , the problem in standard
from becomes
Maximize Z = 4 x 1 + 10 x 2 + 0 s 1 + 0 s 2 + 0 s 3
subject to 2x 1 + x 2 + s 1 + 0 s 2 + 0 s 3 = 50
2x 1 + 5x 2 + 0 s 1 + s 2 + 0 s 3 = 100
2x 1 + 3x 2 + 0 s 1 + 0 s 2 + s 3 = 90
and x 1 , x 2 , s 1 , s 2 , s 3 ³ 0.
Since there are 3 equations with 5 variables, the initial basic feasible solution is obtained
by equating ( 5 - 3) = 2 variables to zero.
\ The initial basic feasible solution is s 1 = 50, s 2 = 100, s 3 = 90
(x 1 = 0, x 2 = 0, non-basic)
The initial simplex table is given by
Cj (4 10 0 0 0)
CB YB XB x1 x2 s1 s2 s3 X Bi
q = min
a ir
0 s1 50 2 1 1 0 0 50
0 s2 100 2 (5) 0 1 0 20*
0 s3 90 2 3 0 0 1 30
(Z j - C j ) 0 -4 -10 0 0 0
Z 2 - C 2 = C B a 2 - C 2 = (0 0 0) [1 5 3] T - 10 = - 10
Z 3 - C 3 = C B a 3 - C 3 = (0 0 0) [1 0 0] T - 10 = 0
Z 4 - C 4 = C B a 4 - C 4 = (0 0 0) [0 1 0] T - 0 = 0
Z 5 - C 5 = C B a 5 - C 5 = (0 0 0) [0 0 1] T - 0 = 0
Since there are some ( Z j - C j ) < 0, the current basic feasible solution is not optimal.
To find the entering variable :
Since ( Z 2 - C 2 ) = - 10 is the most negative, the corresponding non-basic variable
x 2 enters the basis. The column corresponding to this x 2 is called the key column or pivot
column.
To find the leaving variable :
ìX ü ìX ü
Find the ratio q = min í Bi , a ir > 0 ý = min í Bi , a i 2 > 0 ý
î a ir þ î a i2 þ
ì 50 100 90 ü
q = min í , , ý
î 1 5 3þ
= min {50, 20, 30} = 20 which corresponds to s 2
\The leaving variable is the basic variable s 2 which corresponds to the minimum ratio
q = 20. The leaving variable row is called the pivot-row or key row or pivot equation and 5 is the
pivot element. Now, new pivot equation = old pivot equation ¸ pivot element.
= (100 2 5 0 1 0) ¸ 5
2 1
= 20 1 0 0
5 5
æ Corresponding ö
ç ÷ æ New pivot ö
New s 1 equation = old s 1 equation - ç Column ÷ ´ çç ÷÷
ç coefficient ÷ è equation ø
è ø
= 50 2 1 1 0 0
2 1
(-) 20 1 0 0
5 5
8 1
= 30 0 1 - 0
5 5
New s 3 equation = 90 2 3 0 0 1
6 3
( -) 60 3 0 0
5 5
4 -3
= 30 0 0 1
5 5
New ( Z j - C j ) eqn. = 0 -4 - 10 0 0 0
- 20 - 10
( -) - 200 - 10 0 0
5 5
= 200 0 0 0 2 0
41
\ The improved basic feasible solution is given in the following simplex table.
First Iteration :
C j (4 10 0 0 0)
CB YB XB x1 x2 s1 s2 s3
8 1
0 s1 30 0 1 - 0
5 5
2 1
10 x2 20 1 0 0
5 5
4 3
0 s3 30 0 0 - 1
5 5
(Z j - C j ) 200 0 0 0 2 0
Initial iteration :
Cj (3 2 5 0 0 0)
CB YB XB x1 x2 x3 s1 s2 s3 q
0 s1 420 1 4 0 1 0 0 -
460
0 x2 460 3 0 (2) 0 1 0 = 230*
2
430
0 s3 430 1 2 1 0 0 1 = 430
1
Zj -Cj 0 -3 -2 -5 0 0 0
Since there are some ( Z j - C j ) < 0, The current basic feasible solution is not optimal.
To Find the entering variable : Since ( Z 2 - C 3 ) = - 5 is the most negative, the
corresponding non-basic variable x 3 enters into the basis. The column corresponding to this x 3
is called the key column or pivot column.
To find the leaving variable :
ìX ü ìX ü
Find the ratio q = min í Bi , a ir > 0 ý = min í Bi , a i 3 > 0 ý
a
î ir þ a
î i3 þ
ì 460 430 ü
q = min í , ý = min {230, 430} = 230
î 2 1 þ
\ The leaving variable is the basic variable s 2 , which corresponds to the minimum ratio
q = 230. The leaving variable row is called the key row or pivot equation and 2 is the pivot
element.
New pivot equation = old pivot equation ¸ pivot element
= ( 460 3 0 2 0 1 0) ¸ 2
3 1
= 230 0 1 0 0
2 2
æ its entering ö æ New ö
ç ÷ ç ÷
New s 1 equation = old s 1 equation - ç column ÷ ´ ç Pivot ÷
ç coefficient ÷ ç equation ÷
è ø è ø
= 420 1 4 0 1 0 0
( -) 0 0 0 0 0 0 0
= 420 1 0 4 1 0 0
æ its entering ö æ New ö
ç ÷ ç ÷
New s 3 equation = old s 3 equation - ç column ÷ ´ ç Pivot ÷
ç coefficient ÷ ç equation ÷
è ø è ø
= 430 1 2 1 0 0 1
3 1
( -) 230 0 1 0 0
2 2
1 1
= 200 - 2 0 0 - 1
2 2
43
9 5
= 1150 -2 0 0 0
2 2
The improved basic feasible solution is given in the following simplex table
First iteration :
Cj (3 2 5 0 0 0)
CB YB XB x1 x2 x3 s1 s2 s3 q
420
0 s1 420 1 4 0 1 0 0 = 105
4
3 1
5 x3 230 0 1 0 0 —
2 2
-1 1 200
0 s3 200 (2) 0 0 - 1 = 100*
2 2 2
9 5
Zj -Cj 1150 -2 0 0 0
2 2
0 s1 20 2 0 0 1 1 -2
3 1
5 x3 230 0 1 0 0
2 2
-1 -1 1
0 x2 100 1 0 0
4 4 2
Zj -Cj 1150 4 0 0 0 2 1
The unit profit would be Rs. 20, Rs. 6 and Rs. 8 respectively for the gears A, B
and C. Find how much of each gear the company should produce in order to
maximize profit ?
51
Solution. Let x 1 , x 2 and x 3 be and the number of units of gears A, B and C produced
respectively to maximize the profit. The mathematical formulation of the LPP is given by
Maximize Z = 20 x 1 + 6 x 2 + 8x 3
subject to 8x 1 + 2x 2 + 3x 3 £ 250
4 x 1 + 3x 2 £ 150
2x 1 + x 3 £ 50
and x 1 , x 2 , x 3 ³ 0.
By introducing non-negative slack variables s 1 , s 2 and s 3 , the standard from of the LPP
becomes
Maximize Z * = 20 x 1 + 6 x 2 + 8x 3 + 0 s 1 + 0 s 2 + 0 s 3
Subject to the constraints
8x 1 + 2x 2 + 3x 3 + s 1 + 0 s 2 + 0 s 3 = 250
4 x 1 + 3x 2 + 0 s 1 + s 2 + 0 s 3 = 150
2x 1 + 0 x 2 + x 3 + 0 s 1 + 0 s 2 + s 3 = 50
and x 1 , x 2 , x 3 , s 1 , s 2, s 3 ³ 0.
\ The initial basic feasible solution is given by s 1 = 250, s 2 = 150, s 3 = 50
( x 1 = x 2 = x 3 = 0, non-basic).
Initial iteration :
Cj (20 6 8 0 0 0)
CB YB XB x1 x2 x3 s1 s2 s3 q
250
0 s1 250 8 2 3 1 0 0
8
150
0 s2 150 4 3 0 0 1 0
4
50
0 s3 50 (2) 0 1 0 0 1 *
2
Zj -Cj 0 -20 -6 -8 0 0 0
Cj (20 6 8 0 0 0)
CB YB XB x1 x2 x3 s1 s2 s3 q
50
0 s1 50 0 2 -1 1 0 -4
2
50
0 s2 50 0 (3) -2 0 1 -2 *
3
1 1
20 x1 25 1 0 0 0 —
2 2
Zj -Cj 500 0 -6 2 0 0 10
52
Cj (20 6 8 0 0 0)
CB YB XB x1 x2 x3 s1 s2 s3 q
0 s1 50 0 0 1 1 -2 -8 50
3 3 3 3
6 x2 50 0 1 -2 0 1 2 —
-
3 3 3 3
20 x1 25 1 0 æ1ö 0 0 1 50*
ç ÷
è 2ø 2
Zj -Cj 600 0 0 -2 0 2 6
Third iteration : Introduce x 3 and drop x 1 .
Cj (20 6 8 0 0 0)
CB YB XB x1 x2 x3 s1 s2 s3
-2 -2
0 s1 0 0 0 1 -3
3 3
4 1
6 x2 50 1 0 0 0
3 3
8 x3 50 2 0 1 0 0 1
Zj -Cj 700 4 0 0 0 2 8
Since all ( Z j - C j ) ³ 0, the current basic feasible solution is optimal.
\ The optimal solution is Max Z = 700, x 1 = 0, x 2 = 50, x 3 = 50
\The company should produce 50 units of gear B, 50 units of gear of C and none of gear A
in order to have maximum profit Rs. 700.
Artificial Variables Techniques
To solve a LPP by simplex method, we have to start with the initial basic feasible solution
and construct the initial simplex table. In the previous problems, we see that the slack
variables readily provided the initial basic feasible solution. However, in some problems, the
slack variables cannot provide the initial basic feasible solution. In these problems atleast one
of the constraints is of = or ³ type. To solve such linear programming problems, there are two
(closely related) methods avaialble.
(i) The ‘‘Big M-Method’’ or ‘‘M-technique’’ or the ‘‘Method of penalties’’ due to A.
Charnes.
(ii) The ‘‘Two phase’’ method due to Dantzig, Orden and Wolfe.
The Big M-Method :
Step (1) : Express the linear programming problem in the standard form by introducing
slack and/or surplus variables, if necessary.
53
Step (2) : Introduce the non-negative artificial variables R1 , R2 ... to the left hand side of
all the constraints of ³ or = type. The purpose of introducing artificial variables is just to obtain
an initial basic feasible solution. However, addition of these artificial variables causes violation
of the corresponding constraints. Therefore we would like to get rid of these variables and
would not allow them to appear in the final solution. To achieve this we assign a very large
penalty (-M for maximization problems and +M for minimization problems) as the coefficients
of the artificial variables in the objective function.
Step (3) : Solve the modified linear programming problem by simplex method.
(i) If no artificial variable remains in the basis and the optimality condition is
satisfied,then the current solution is an optimal basic feasible solution.
(ii) If atleast one artificial variable appears in the basis at zero level (with zero value of
X B column) and the optimality condition is satisfied, then the current solution is
an optimal basic feasible (though degenerated) solution.
(iii) If atleast one artificial variable appears in the basis at non-zero level (with positive
value in X B column) and the optimality condition is satisfied, then the original
problem has no feasible solution. The solution satisfies the constraints but does not
optimize the objective function since it contains a very large panalty M and is called
pseudo-optimal solution.
Note : While applying simplex method, whenever an artificial variable happens to leave
the basis, we drop that artificial variable and omit all the entries corresponding to its column
from the simplex table.
* Example 13 : Solve the following LPP by simplex method :
Maximize Z = 3 x 1 + 2 x 2
subject to 2 x1 + x 2 £ 2
3 x 1 + 4 x 2 ³ 12
and x 1 , x 2 ³ 0.
Solution : By introducing the non-negative slack variable s 1 and surplus variable s 2 ,
the standard from of the LPP becomes
Maximize Z = 3x 1 + 2x 2 + 0 s 1 + 0 s 2
Subject to 2x 1 + x 2 + s 1 + 0 s 2 = 2
3x 1 + 4 x 2 + 0 s 1 - s 2 = 12
x 1 , x 2 , s 1 , s 2 ³ 0.
But this will not yield a basic feasible solution. To get the basic feasible solution, add the
artificial variable R1 to the left hand side of the constraint equation which does not possess the
slack variable not assign—M to the artificial variable in the objective function. The LPP
becomes
Max. Z = 3x 1 + 2x 2 + 0 s 1 + 0 s 2 - MR1
Subject to 2x 1 + x 2 + s 1 + 0 s 2 = 2
3x 1 + 4 x 2 + 0 s 1 - s 2 + R1 = 12
x 1 , x 2 , s 1 , s 2 , R1 ³ 0
54
Since there are some ( Z j - C j ) < 0, The current basic feasible solution is not optimal.
The non-basic variable x 2 enters into the basis and the basic variable s 1 leaves the basis.
First iteration :
Cj (3 2 0 0 -M )
CB YB XB x1 x2 s1 s2 R1
2 x2 2 2 1 1 0 0
-M R1 4 -5 0 -4 -1 1
Zj -Cj -4 M + 4 - 5M + 1 0 4M + 2 M 0
possess the slack variables and assign -M to the artificial variables in the objective function. So
the LPP becomes
Max Z = x 1 + 2x 1 + 3x 3 - x 4 + 0 s 1 + 0 s 2 - MR1 - MR2 - MR3
subject to the constraints
x 1 + 2x 2 + 3x 3 + 0 s 1 + 0 s 2 + R1 = 15
2x 1 + x 2 + 5x 3 - s 1 + 0 s 2 + R2 = 20
x 1 + 2x 2 + x 3 + x 4 + 0 s 1 - s 2 + R3 = 10
x 1 , x 2 , x 3 , x 4 , s 1 , s 2 , R1 , R2 , R3 ³ 0
The initial basic feasible solution is given by
R1 = 15, R2 = 20, R3 = 10 (basic) (x 1 = x 2 = x 3 = x 4 = s 1 = s 2 = 0, non-basic)
Initial iteration :
Cj (1 2 3 -1 0 0 -M -M -M)
CB YB XB x1 x2 x3 x4 s1 s2 R1 R2 R3 q
15
-M R1 15 1 2 3 0 0 0 1 0 0 =5
3
20
-M R2 20 2 1 (5) 0 -1 0 0 1 0 =4
5
10
-M R3 10 1 2 1 1 0 -1 0 0 1 = 10
1
(Z j - C j ) -45 M - 4M -1 - 5M - 2 -9M-3 - M+1 M M 0 0 0
Since there are some ( Z j - C j ) < 0, the current basic feasible solution is not optimal.
The non basic variable x 3 enters into the basis and basic variable R2 leaves the basis.
Also since the artificial variable R2 leaves the basis, we drop that artificial variable R2 and
omit all the eateries corresponding to its column form the simplex table.
First iteration :
Cj (1 2 3 -1 0 0 -M -M)
CB YB XB x1 x2 x3 x4 s1 s2 R1 R3 q
1 æ7 ö 3 15
-M R1 3 - ç ÷ 0 0 0 1 0
5 è 5ø 5 7
2 1 -1
3 x3 4 1 0 0 0 0 20
5 5 5
3 9 1 30
-M R3 6 0 1 -1 0 1
5 5 5 9
-9 M -2M + 1 -16 M - 7 - M -4 M - 3
Zj -Cj 0 M 0 0
+ 12 5 5 +1 5
Since there are some ( Z j - C j ) < 0 , the current basic feasible solution is not optimal;.
56
The nonbasic variable x 2 enters into the basis and the basic variable R1 leaves the basis.
Second iteration :
Cj (1 2 3 -1 0 0 -M)
CB YB XB x1 x2 x3 x4 s1 s2 R3 q
15 -1 3
2 x2 1 0 0 0 0 —
7 7 7
25 3 -2
3 x3 0 1 0 0 0 —
7 7 7
15 6 -4 15
-M R3 0 0 (1) -1 1
7 7 7 7
-15M + 105 - 6M 4M
(Z j - C j ) 0 0 - M+1 M 0
7 7 7
Since there are some ( Z j - C j ) < 0 , the current basic feasible solution is not optimal.
The non basic variable x 4 enters into the basis and the basic variable R3 leaves the basis.
Third iteration :
Cj (1 2 3 -1 0 0)
CB YB XB x1 x2 x3 x4 s1 s2 q
15 -1 3
2 x2 1 0 0 0 —
7 7 7
25 3 -2 25
3 x3 0 1 0 0
7 7 7 3
15 æ6 ö -4 15
-1 R4 ç ÷ 0 0 1 -1
7 è7 ø 7 6
90 -6 4
Zj -Cj 0 0 0 1
7 7 7
-6
Since there are some ( Z j - C j ) =
< 0, the current basic feasible solution is not optimal.
7
The non-basic variable x 1 enters the basic and the basic variable x 4 leaves the basis.
Fourth iteration :
Cj (1 2 3 -1 0 0)
CB YB XB x1 x2 x3 x4 s1 s2
5 1 1 -1
2 x2 0 1 0
2 6 3 6
5 -1 1
3 x3 0 0 1 0
2 2 2
5 7 -2 -7
1 x1 1 0 0
2 6 3 6
(Z j - C j ) 15 0 0 0 1 0 0
57
Since there are some ( Z *j - C j ) < 0 , the current basic feasible solution is not optimal.
The non-basic variable x 1 enters into the basis and the basic variable R1 leaves the basis.
First iteration :
Cj (- 4 -3 0 0 0 -M)
CB YB XB x1 x2 s1 s2 s3 R2 q
1 -1
-4 x1 5 1 0 0 0 10
2 2
7 -3 42
0 s2 21 0 1 0 0
2 2 7
æ1ö 1
-M R2 1 0 ç ÷ 0 -1 1 2
è 2ø 2
-M +2 -M +4
(Z *j - C j ) -M - 20 0 0 M 0
2 2
Since there are some ( Z *j - C j ) < 0 , the current basic feasible solution is not optimal.
The non-basic variable x 2 enters into the basis and the basic variable R2 leaves the
basis.
Second iteration :
Cj (- 4 -3 0 0 0)
CB YB XB x1 x2 s1 s2 s3
-4 x1 4 1 0 -1 0 1
0 s2 14 0 0 -5 1 7
-3 x2 2 0 1 1 0 -2
( Z *j - C j ) - 22 0 0 1 0 2
Solution : By introducing the non-negative slack, surplus and artificial variables, the
standard from of the LPP becomes
Max Z = 2x 1 + x 2 + x 3 + 0 s 1 + 0 s 2 + 0 s 3 - MR1
subject to 4 x 1 + 6 x 2 + 3x 3 + s 1 + 0 s 2 + 0 s 3 = 8
3x 1 - 6 x 2 - 4 x 3 + 0 s 1 + s 2 + 0 s 3 = 1
2x 1 + 3x 2 - 5x 3 + 0 s 1 + 0 s 2 + s 3 + R1 = 4
and x 1 , x 2 , x 3 , s 1 , s 2 , s 3 , R1 ³ 0
(Here : s 1 , s 2 - slack, s 3 - surplus, R1 - artificial)
s 1 = 8, s 2 = 1, R1 = 4 (basic) (x 1 = x 2 = x 3 = s 3 = 0, non-basic)
Initial iteration :
Cj (2 1 1 0 0 0 -M)
CB YB XB x1 x2 x3 s1 s2 s3 R1 q
8
0 s1 8 4 6 3 1 0 0 0 = 13
.
6
0 s2 1 3 -6 -4 0 1 0 0 -
4
-M R1 4 2 (3) -5 0 0 -1 1 = 133
.
3
(Z j - C j ) - 4M -2M - 2 - 3M - 1 5M - 1 0 0 M 0
Since there are some ( Z j - C j ) < 0, the current basic feasible solution is not optimal.
The non-basic variable x 2 enters into the basis and the basic variable R1 leaves the
basis.
First iteration :
Cj (2 1 1 0 0 0)
CB YB XB x1 x2 x3 s1 s2 s3 q
0 s1 0 0 0 (13) 1 0 2 0
0 s2 9 7 0 -14 0 1 -2 -
4 2 -5 -1
1 x1 1 0 0 —
3 3 3 3
4 -4 -8 -1
(Z j - C j ) 0 0 0
3 3 3 3
Since there are some ( Z j - C j ) < 0, the current basic feasible solution is not optimal.
The non-basic variable x 3 enters into the basis and the basic variable s 1 leaves the basis.
60
Second iteration :
Cj (2 1 1 0 0 0)
CB YB XB x1 x2 x3 s1 s2 s3 q
1 2
1 x3 0 0 0 1 0 —
13 13
14 2 9
0 s2 9 (7) 0 0 1
13 13 7
4 2 5 -1
1 x2 1 0 0 2
3 3 39 13
4 -4 8 1
(Z j - C j ) 0 0 0
3 3 39 13
Since there are some ( Z j - C j ) < 0, the current basic feasible solution is not optimal.
The non-basic variable x 1 enters into the basis and the basic variable s 2 leaves the basis.
Third iteration :
Cj (2 1 1 0 0 0)
CB YB XB x1 x2 x3 s1 s2 s3 q
1 2
1 x3 0 0 0 1 0
13 13
9 2 1 2
2 x1 1 0 0
7 13 7 91
10 1 -2 -25
1 x2 0 1 0
21 39 21 273
64 16 4 +29
(Z j - C j ) 0 0 0
21 39 21 273
Since all ( Z j - C j ) < 0, the current basic feasible solution is optimal.
64 9 10
\ The optimal solution is Max Z = , x1 = , x 2 = , x 3 = 0.
21 7 21
The Two Phase Method
The two phase method is another method to solve a given problem in which some
artificial variables are involved. The solution is obtained in two phases as follows :
Phase-I
In this phase, the simplex method is applied to a specially constructed auxiliary linear
programming problem leading to a final simplex table containing a basic feasible solution to
the original problem.
Step 1 : Assign a cost - 1 to each artificial variable and a cost 0 to all other variables (in
place of their original cost) in the objective function. Thus the new objective function is Z *
= - R1 - R2 - R3 -.....- Rn
where Ri ' s are the artificial variables.