Two Phase Matrix Method
Two Phase Matrix Method
Whenever artificial variables are part of the initial solution, the last row (i.e. the (cj – zj) row) of the Initial
Simplex tableau will contain the penalty cost M. Then, the following modifications are incorporated into the Simplex
method; the resulting algorithm is the two-phase method.
Change 1: The last row of Tableau 1 is decomposed into two rows, the first of which involves those terms not
containing M, while the second involves the coefficients of M in the remaining terms.
[ -9 0 -9 0 0 0 -14
-8 0 -9 0 1 0 -2 ]
Change 2: Step 1 of the simplex algorithm method is applied to the last row in change 1 (followed by steps 2, 3 and 4)
until this row contains no negative elements. Then step 1 is applied to those elements in the next-to-last row that are
positioned over zeros in the last row.
Change 3: Whenever an artificial variable ceases to be basic – i.e. is removed from the first column of the tableau as a
result of step 4 – it is deleted from the top row of the tableau, as is the entire column under it.
Change 4: The last row can be deleted from the tableau whenever it contains all zeros.
Change 5: If nonzero artificial variables are present in the final basic set, then the program has no solution. (In contrast,
zero-valued artificial variable may appear as basic variables in the final solution when one or more of the original
constraint equations is redundant).
Ex: Minimize, Z = 80 X1 + 60 X2
Subject to: 0.20 X1 + 0.32 X2 <= 0.25
X1 + X2 = 1
With: X1 and X2 non-negative.
Ans: Solution by Two-phase method. Adding a slack variable x3 and an artificial variable x4 to the first and second
constraints, respectively, we convert the LPP to standard matrix form as follows;
Minimize, Z = 80 X1 + 60 X2 + 0 X3 + M X4
xj x1 x2 x3 x4 B
cj 80 60 0 M i.e. Ratio
Co RHS
x4 M 1 1 0 1 1
1
CoT A =
M M 0 M
zj CoT B =
-M
(cj – zj) 80 - M 60 - M 0 0
xj x1 x2 x3 x4
cj 80 60 0 M B Ratio
Co
x4 M 1* 1 0 1 1 1.00
80 60 0 0 0
(cj – zj)
-1 -1 0 0 -1
1. Arbitrarily selecting the x1 column as the work column, we form the ratios. Since the element 1 starred in
Tableau 2, yields the smallest ratio, it becomes the pivot element. Then, applying steps 3 and 4 and change 3
to Tableau 2, we generate tableau 3. Important, for minimization problem, we have to maintain the B
element in the last row i.e. the row of (cj – zj) in negative values.
Simplex Tableau 3
xj x1 x2 x3 x4
cj 80 60 0 M B Ratio
Co
x1 80 1 1 0 1 1
Observe that x1 replaces the artificial variable x4 in the first column of tableau 3, so that the entire x4 column is
absent in tableau 4 (Whenever an artificial variable ceases to be basic – i.e. is removed from the first column of
the tableau…….).
Simplex Tableau 4
xj x1 x2 x3 B Ratio
2
cj 80 60 0
Co
x3 0 0 0.12 1 0.05
x1 80 1 1 0 1
0 - 20 0 - 80
(cj – zj)
0 0 0 0
Now, with no artificial variables in the first column and with change 3 implemented, the last row of the tableau
should be all zeros. It is: and by change 4 this row may be deleted.
Simplex Tableau 5
xj x1 x2 x3
cj 80 60 0 B Ratio
Co
x1 80 1 1 0 1.00 1
Simplex Tableau 6
xj x1 x2 x3
cj 80 60 0 B Ratio
Co
x2 60 0 1 25/3 5/12
x1 80 1 0 -25/3 7/12
Ex: Minimize, Z = 1 X1 + 2 X2
Subject to: 1 X1 + 3 X2 >= 11
2 X1 + 1 X2 >= 9
With: X1 and X2 non-negative.
Ans: Solution by Two-phase method. The program is put into standard form by introducing surplus variables X3 and
X4 respectively, in the constraints inequalities, and then artificial variables X5 and X6 respectively, in the resulting
equations. We get the standard form as follows
3
Minimize, Z = 1 X1 + 2 X2 + 0 X3 + 0 X4 + M X5 + M X6
Subject to: 1 X1 + 3 X2 - 1 X3 + 0 X4 + 1 X5 + 0 X6 = 11
2 X1 + 1 X2 + 0 X3 - 1 X4 + 0 X5 + 1 X6 = 9
And X1, X2, X3, X4, X4, X5 and X6 are non-negative.
For Minimization LPP
Simplex Tableau 0 (Identical with the big M Method up to this tableau)
xj x1 x2 x3 x4 x5 x6 B
cj 1 3 0 0 M M i.e. Ratio
Co RHS
x5 M 1 3 -1 0 1 0 11
x6 M 2 1 0 -1 0 1 9
CoT A =
3M 4M -M -M M M
zj -CoT B
= -20M
(cj – zj) 1- 3M 2-4M M M 0 0
xj x1 x2 x3 x4 x5 x6
cj 1 3 0 0 M M B Ratio
Co
x5 M 1 3* -1 0 1 0 11 11/3
x6 M 2 1 0 -1 0 1 9 9
1 2 0 0 0 0 0
(cj – zj)
-3 -4 1 1 0 0 -20
1. The last row of Tableau 0 is decomposed into two rows, the first of which involves only those terms not
containing M, while the second one involves the coefficients of M in the remaining terms.
2. Then we consider only the last row of tableau 1 i.e. the second row of (cj – zj) involving only the
coefficients of M and select that variable as the next entering variable for which the negative element is
highest in this row.
3. Next, the variable to go is selected by usual procedure of lowest positive value of the ratio. Then we find the
pivot element.
4. Once the pivot element is found, then by usual row manipulation method, we transform the pivot element
into 1 and rest all other elements of the pivot column as zeros. This will include all elements of the pivot
column including the last row of the tableau1 i.e. the second row of (cj – zj).
5. Whenever an artificial variable ceases to be basic – i.e. is removed from the first column of the tableau as a
result of above operations, it is deleted from the top row of the tableau, as is the entire column under it.
6. Thus we form Tableau 2 as follows.
Simplex Tableau 2
xj x1 x2 x3 x4 x6 B Ratio
4
cj 1 2 0 0 M
Co
2. Important, for minimization problem, we have to maintain the B element in the last row i.e. the row of (cj –
zj) in negative values.
3. We repeat the procedure and get tableau 3.
Simplex Tableau 3
xj x1 x2 x3 x4
cj 1 2 0 0 B Ratio
Co
1. Important, for minimization problem, we have to maintain the elements in the last two rows i.e. the rows of
(cj – zj) in negative values.
2. The last row is deleted from the tableau whenever it contains all zeros. We get tableau 4.
Simplex Tableau 4
xj x1 x2 x3 x4
cj 1 2 0 0 B Ratio
Co
Since in tableau 4, the (cj – zj) row does not contain any negative element, we have reached the optimality. The
optimum solution is :- X1* = 16/5; X2* = 13/5 and Z* = (-) (-42/5) = 42/5.
Ex: Maximize, Z = 5 X1 + 2 X2
Subject to: 6 X1 + 1 X2 >= 6
5
4 X1 + 3 X2 >= 12
1 X1 + 2 X2 >= 4
With: X1 and X2 non-negative.
Ans: Solution by Two-phase method. The program is put into standard form by introducing surplus variables X3, X4
and X5 respectively, in the constraints inequalities, and then artificial variables X6, X7 and X8 respectively, in the
resulting equations. We get the standard form as follows: -
Maximize, Z = 5 X1 + 2 X2 + 0 X3 + 0 X4 + 0 X5 - M X6 – M X7 – M X8
Subject to: 6 X1 + 1 X2 - 1 X3 + 0 X4 + 0 X5 + 1 X6 + 0 X7 + 0 X8 = 6
4 X1 + 3 X2 + 0 X3 - 1 X4 + 0 X5 + 0 X6 + 1 X7 + 0 X8 = 12
1 X1 + 2 X2 + 0 X3 + 0 X4 - 1 X5 + 0 X6 + 0 X7 + 1 X8 = 4
And X1, X2, X3, X4, X4, X5, X6, X7 and X8 are non-negative.
For Maximization LPP
Simplex Tableau 0 (Identical with the big M Method up to this tableau)
xj x1 x2 x3 x4 x5 x6 x7 x8 B
cj 5 2 0 0 0 -M -M -M i.e. Ratio
Co RHS
x6 -M 6 1 -1 0 0 1 0 0 6
x7 -M 4 3 0 -1 0 0 1 0 12
x8 -M 1 2 0 0 -1 0 0 1 4
CoT A =
-11M -6M M M M -M -M -M
zj CoT B =
-22M
(zj– cj) -5 -2 –
M M M 0 0 0
-11M 6M
xj x1 x2 x3 x4 x5 x6 x7 x8 B
cj 5 2 0 0 0 -M -M -M i.e. Ratio
Co RHS
x6 -M 6* 1 -1 0 0 1 0 0 6 1
x7 -M 4 3 0 -1 0 0 1 0 12 3
x8 -M 1 2 0 0 -1 0 0 1 4 4
-5 -2 0 0 0 0 0 0 0
(zj– cj)
-11 -6 1 1 1 0 0 0 -22
6
1. The last row of Tableau 0 is decomposed into two rows, the first of which involves only those terms not
containing M, while the second one involves the coefficients of M in the remaining terms.
2. Then we consider only the last row of tableau 1 i.e. the second row of (zj– cj) involving only the coefficients
of M and select that variable as the next entering variable for which the negative element is highest in this
row.
3. Next, the variable to go is selected by usual procedure of lowest positive value of the ratio. Then we find the
pivot element.
4. Once the pivot element is found, then by usual row manipulation method, we transform the pivot element
into 1 and rest all other elements of the pivot column as zeros. This will include all elements of the pivot
column including the last row of the tableau1 i.e. the second row of (zj– cj).
5. Whenever an artificial variable ceases to be basic – i.e. is removed from the first column of the tableau as a
result of above operations, it is deleted from the top row of the tableau, as is the entire column under it.
6. Thus we form Tableau 2 as follows.
Simplex Tableau 2
xj x1 x2 x3 x4 x5 x7 x8 B
cj 5 2 0 0 0 -M -M i.e. Ratio
Co RHS
x1 5 1 1/6 -1/6 0 0 0 0 1 6
0 -7/6 -5/6 0 0 0 0 5
(zj– cj)
0 -25/6 -5/6 1 1 0 0 -11
Simplex Tableau 3
xj x1 x2 x3 x4 x5 x7 B
cj 5 2 0 0 0 -M i.e. Ratio
Co RHS
7
Simplex Tableau 4
xj x1 x2 x3 x4 x5 B
cj 5 2 0 0 0 i.e. Ratio
Co RHS
0 0 -0.50 -0.50 0 9
(zj– cj)
0 0 0.00 0 0 0
Simplex Tableau 5
xj x1 x2 x3 x4 x5 B
cj 5 2 0 0 0 i.e. Ratio
Co RHS
x4 0 14 0 -3 1 0 6
x5 0 11 0 -2 0 1 8
x2 2 6 1 -1 0 0 6
(zj– cj) 7 0 -2 0 0 12
Tableau 5 presents a problem that cannot be ignored; the work column is the x3 column and all the elements in
that column are negative. It means that the original program has no solution.
Graphical Solution:
8
9