Download as pdf or txt
Download as pdf or txt
You are on page 1of 28

Center for Computer Studies Institute of Business Administration

Quantitative Methods of Business Decisions MBA-II Handout # 4

How to solve a non-standard problem?


(Ref:-http://www.saintmarys.edu/~psmith/338act14.html)
Artificial Variables and the Two-phase Simplex Method
WHY?:

This activity is designed to help you understand the process of solving linear
programming problems which do not contain an Identity sub-matrix in the
initial tableau. We show how artificial variables can be introduced and the
objective function changed so that the Simplex Method will force the artificial
variables out of the basis and replace them with problem variables. The two-
phase procedure completes the study of the simplex solution method and allows
us to solve any LP problem to find its optimal solution or discover whether it is
unbounded or infeasible.
VOCABULARY:

Pseudo Standard Form


In the given LP we first convert all constrains of ≤ form into = form by
adding slack variables. And then convert all constrains of ≥ form into =
form by subtracting surplus variables. After that we multiply all those
constraints by – 1 whose RHS is negative. So, that the problem under
discussion will be of the form:

Maximize p = ctx,

subject to Ax = b,

x ≥ 0.

Please note that the constant vector b is ≥ 0. Such a problem is called


Pseudo Standard Form

Week 4 Page 1 of 28
Artificial Variable

An Artificial Variable is a nonnegative quantity added to the left side of


exactly one constraint of an LP problem in Pseudo Standard Form.
Enough artificial variables are added to the constraints so that the resulting
coefficient matrix contains an m x m Identity sub-matrix (where m is the
number of constraints other than non-negativity constraints). Although
they are initially basic variables when we apply the simplex method,
artificial variables must be driven out of the basis so that their values are
zero in the final solution. If this is not possible, then the problem is
infeasible (i.e. its constraints are contradicting each other).

Two-Phase Simplex Method

This extended form of the Simplex Method first drives the artificial
variables out of the basis and then solves the original problem.
TWO-PHASE SIMPLEX Methodology

Add slack or subtract surplus variables to put all nontrivial


constraints into = form and then multiply all those constraints
1. Put in by – 1 whose RHS is negative. Then the problem will be of
Pseudo the form: Maximize p = ct x subject to Ax = b, x ≥ 0. Here c =
Standard Form [c1, c2, ..., cn]t, x = [x1, x2, ..., xn]t, b = [b1, b2, …, bm]t are
column vectors and A is a matrix of order m by n. Please note
that vector b is non-negative here.
Add a new variable, called artificial variable, to the left side
2. Add
of that constraint which has no apparent basic variable.
Artificial
(Usually such a constraint was originally either of ≥ or = to
Variables
form).
3. Change
Set up a new objective function equal to the negative of the
Objective
sum of the artificial variables.
Function
4. Perform Set up the simplex tableau and pivot to reach a solution
Phase I where bottom row ≥ 0.

Week 4 Page 2 of 28
If the solution to step 4 is not 0, the problem is infeasible. If it
5. Check for
is 0, remove the rest of artificial variables which are still in the
Feasibility
basis.
6. Insert old Replace bottom row of the final tableau in phase I with the
Objective negative of original standard form objective function. Make
Function sure there are no basic variables in it.
7. Perform Continue pivoting until an optimal solution is reached or the
Phase II problem becomes unbounded.

A SIMPLE EXAMPLE:

1. Pseudo standard form:


maximize p = x1 - x2 maximize p = x1 - x2
subject to: 6x1 - x2  10 subject to: 6x1 - x2 + x4 = 10
x1 + 5x2  4 x1 + 5x2 - x5 = 4
x1 + 5x2 + x3 = 5 x1 + 5x2 + x3 = 5
x1  0, x2  0, x3  0 xi  0 for all i

2. Add Artificial Variables. We need only one artificial variable x6 in constraint


2. Constraint 1 already has a slack variable and constraint 3 has x 3 with a
coefficient 1 and x3 does not appear in any other constraint. Thus the column
corresponding to x3 will be part of the required Identity sub-matrix.

3. Change Objective Function

The new objective function for phase 1 will be p’ = - x6. Phase I problem is:
maximize p’ = - x6
subject to: 6x1 - x2 + x4 = 10
x1 + 5x2 - x5 + x6 =4
x1 + 5x2 + x3 =5

Week 4 Page 3 of 28
xi  0 for all i

Here x3, x4, and x6 are basic variables and others are non-basic variables.
We need to write p’ in terms of non-basic variables: p’ = - x6 = x1 + 5x2
- x5 - 4. We can now,
4. Perform Phase I

Initial Phase I simplex tableau:

x1 x2 x3 x4 x5 x6 p’ RHV ratio

x4 | 6 -1 0 1 0 0 0| 10 | -
x6 | 1 (5) 0 0 -1 1 0| 4 | 0.8 (min)
x3 | 1 5 1 0 0 0 0| 5 | 1
|-------------------------|
p’ |-1 -5 0 0 1 0 1| -4 |

Now, we can start the simplex process: x2 should replace x6 (min ratio 4/5);
The new tableau is

x1 x2 x3 x4 x5 x6 p’ RHV

x4 | 6.20 0 1 -0.2 0.2 0| 10.8 |


x2 | 0.21 0 0 -0.2 0.2 0| 0.8 |
x3 | 00 1 0 1 -1 0| 1 |
|---------------------------------|
p’ | 0 0 0 0 0 1 1| 0 |

5. Check for Feasibility

The solution to step 4 is p' = 0. The artificial variable x6 is no longer in the basis
so we can drop it. We can also drop p’ row and p’ column.
Week 4 Page 4 of 28
6. Insert old Objective Function

Since p = x1 – x2 = x1 + 0.2 x1 – 0.2 x5 – 0.8 = 1.2 x1 – 0.2 x5 – 0.8


The initial Phase II tableau as follows:

x1 x2 x3 x4 x5 p RHV

x4 |(6.2) 0 0 1 -0.2 0 | 10.8 |


x2 | 0.2 1 0 0 -0.2 0 | 0.8 |
x3 | 0 0 1 0 1 0 | 1 |
|-----------------------------|
p |-1.2 0 0 0 0.2 1 | -0.8 |
7. Perform Phase II

We need to bring in x1 in place of x4 since min ratio is 10.8/6.2.


Final tableau is:

x1 x2 x3 x4 x5 p RHV

x1 | 1 0 0 0.16 -0.03 0| 1.74 |


x2 | 0 1 0 -0.03 -0.19 0| 0.45 |
x3 | 0 0 1 0 1 0| 1 |
|-----------------------------|
p | 0 0 0 0.19 0.16 1| 1.29 |
Optimal solution is x1 = 1.74, x2 = 0.45, x3 = 1, x4 = x5= 0 and p = 1.29.

Why?

DISCUSSION:

Week 4 Page 5 of 28
Step 1. Put in Pseudo Standard Form

In order to solve a problem using the simplex method we must replace the
constraint inequalities by equalities. This is what is done by converting the
problem to pseudo standard form. Doing this increases the dimension of the
feasible region, but there is a 1-1 correspondence between the extreme points
of the original feasible region and those of the new feasible region. Thus,
solutions to the problem in standard form yields solutions to the original
problem.

Step 2. Add Artificial Variables

In order to start the simplex method, we need an Identity sub-matrix in the


simplex tableau. If the original constraints were  , we added a slack variable
which gave rise to a pivot column in the coefficient matrix. Otherwise, we
subtracted a surplus variable (in the  case) or did nothing (in the = case). To
force an Identity sub-matrix, we add variables, called artificial variables, to the
constraints which do not contribute basic variables. This ensures an initial basic
feasible solution. We then do pivot operations to force the artificial variables
out of the basis and obtain a basic feasible solution which is an extreme point
of the problem in pseudo standard form.

Step 3. Change Objective Function

We need to set up a new objective function equal to the negative of the sum of
the artificial variables. Since the artificial variables are nonnegative, the
objective function value will always be non-positive. We want to force the
artificial variables to become 0 in order to drive them out of the basis. Thus the
optimal solution with objective function p' will be p' = 0.

Step 4. Perform Phase I

To obtain an optimal solution p' = 0 for the problem with artificial variables and
the objective function constructed in Step 3, we construct a simplex tableau and
pivot using the minimum ratio rule until the artificial variables have been driven
from the basis. This process is called Phase I. The first set of pivots is always
focused on getting zeros under the basic columns in the tableau. After this is
accomplished, we choose columns with negative last row entries to come into
the basis if their minimum ratio will be in a row containing a pivot in an artificial
variable column.
Week 4 Page 6 of 28
Step 5. Check for Feasibility

If the optimal solution from the Phase I simplex method has a negative objective
function value then the problem we are working on has no points in its feasible
region, and hence is infeasible. If p' = 0, we can continue pivoting (without
changing the objective function value) until all the artificial variable columns
have been dropped from the simplex tableau.

Step 6. Insert Old Objective Function

We are ready to start solving the original problem, since Phase I has produced
an Identity sub-matrix in the simplex tableau. We insert the negative of the
coefficients of the original objective function in pseudo standard form in the
bottom row of the tableau (make sure you also eliminate any basic variables
within it).

Step 7. Perform Phase II

We proceed with the usual simplex method to reach an optimal solution or


discover that the problem is unbounded.
EXAMPLE OF THE TWO-PHASE SIMPLEX METHODOLOGY

See any book or website of your interest.


LEARNING OBJECTIVES:

1. Discover when and how to introduce artificial variables in a linear


programming problem.
2. Discover how to solve a two-phase problem or else tell when it is
unbounded or infeasible using the Simplex Method.
3. Take time to review group expectations.
SKILL EXERCISES:

Solve the following LP:


a) minimize 3x1 - x2 + x3
subject to: x1 + x2 = 3
2x1 + 4x2 - x3 ≥ 2
x1 ≥ 0, x2 ≥ 0, x3 ≥ 0

Week 4 Page 7 of 28
b) maximize 3x1 - x2 + x3
subject to: x1 + x2 = 3
2x1 - 4x2 + x3 ≥ 3
2x1 + 2x2 - x3 ≥ 2
x1 ≥ 0, x2 ≥ 0, x3 ≥ 0

c) maximize 2x1 - x2 - x3
subject to: x1 + x2 + x4 = 3
3x1 + 4x2 - 5x3 ≤ 4
2x1 + x2 + x3 + x4 ≥ 2
2x1 + x2 + x3 + x4 = 5
x1 ≥ 0, x2 ≥ 0, x3, x4 ≥ 0

d) minimize 3x1 - x2 + 2x3


subject to: x1 + x2 = 3
2x1 + 4x2 - x3 ≥ 2
2x1 + 4x2 - x3 = 2
x1 ≥ 0, x2 ≥ 0, x3 ≥ 0

Phase one of Simplex Method without any Artificial Variable.


In case of artificial variables, we have to introduce as many columns as there are artificial
variables into the system. Also we have to have another objective function. This increases
the size of the problem unnecessarily.

The present method is an alternative method to get a feasible corner point of the LP (if the
LP is indeed having a feasible point) or declare that the LP is infeasible without using any
artificial variable.

Methodology

Week 4 Page 8 of 28
First convert the ≥ type constraints (excluding non-negativity
constraints of the decision variables) into ≤ type by multiplying
them by –1. Add slack variables to put the problem in the form:
Maximize p = ct x subject to A x = b, x ≥ 0. Here c = [c1, c2, …,
1. Put in Semi t t t
Standard Form cn] , x = [x1, x2,…, xn] , b = [b1, b2,…, bm] are column vectors
and A is a matrix of order m by n. Note the vector b is no more
required to be non-negative here (some entries of b may be
negative). Put all the data along with objective row in an initial
tableau.
Declare all slack variables as basic variables (note a basic
variable may not be a feasible one at this stage i.e. current value
may be negative, though the corresponding column is still in the
form of a unit vector). At this point all rows of the tableau which
do not have any slack variable, may not have basic variables.
2. Producing Let i be any such row. Let aij be any non-zero entry in that row.
initial basic
variables Pivot about aij to convert jth column into a unit column and
declare xj as basic variable (again it may not be a feasible one
at this stage i.e. current value may be negative). Repeat this
procedure for all the remaining rows which do not have basic
variables so far. If all initial basic variables are also feasible, go
to phase II of the simplex method (as you don’t need phase I).
Let i be the row in which last value is negative (which means
the basic variable associated with this row is infeasible). Let aij
be any other negative entry in the same row (in case all other
entries are non-negative, the LP is infeasible and we terminate
the problem). The jth column is now the pivot column, which
means the xj is the entering basic variable which will either
3. Perform th
Phase I replace the current basic variable of i row or some other basic
variable.
In order to decide which variable is to leave the basis (which is
same as which row will be the pivoting row) we need to
calculate the following:
𝑏𝛼 𝑏𝑚
= max{ | 𝑏𝑚 < 0 𝑎𝑛𝑑 𝑎𝑚𝑗 < 0}.
𝑎𝛼𝑗 𝑎𝑚𝑗

Week 4 Page 9 of 28
We pivot about aαj if there is no positive entry in the jth column
along with corresponding nonnegative entry in the last column
(i.e. RHS column). After pivoting the old basic variable
associated with the αth row will now become non-basic.
If jth column has some positive entries along with corresponding
nonnegative entries in the last column (i.e. RHS column), then
we pivot about the akj where k is the index such that
𝑏𝑘 𝑏𝛼 𝑏𝑚
= min{ , | 𝑏𝑚 ≥ 0 𝑎𝑛𝑑 𝑎𝑚𝑗 > 0}.
𝑎𝑘𝑗 𝑎𝛼𝑗 𝑎𝑚𝑗

After pivoting the old basic variable associated with the kth row
will now become non-basic.

And we repeat this procedure, until all the basic variables


become feasible or problem detected to be infeasible. See
Remark below.
4. Perform If problem is feasible, switch to phase II, i.e., continue pivoting
Phase II according to the rules of phase II.

Remark:- The above rules are likely to be good because:

1. The nonnegative values in the last column stay nonnegative after pivoting, and
2. bi has become no smaller (generally it gets larger).
3. Many other negative values in last column may also be improved (we take this a bonus).
Proof. There are three cases to be considered.
th
Case 1 - There is no positive entry in the j column along with corresponding
nonnegative entry in the last column (i.e. RHS column), and we pivot about aαj
which is negative. So after first requirement of pivoting about aαj, we will get ̅̅̅̅
𝑎𝛼𝑗 = 1
̅̅̅ 𝑏𝛼
and 𝑏 𝛼= > 0. In order to convert all other nonzero entries in the jth column to 0, we
𝑎𝛼𝑗
either add the positive multiples of new version of αth row to other rows or add the negative
multiples of new version of α th row to other rows.

If we are adding the positive multiples of new version of αth row to other rows, then we
̅̅̅
are also adding the same positive multiples of 𝑏 𝛼 (> 0) to corresponding entries of RHS
column. So, those entries will have some more addition of positive numbers. So no danger
of reduction in those values of RHS column.

Week 4 Page 10 of 28
If we are adding the negative multiples of new version of αth row to other rows, then we
̅̅̅
are also adding the same negative multiples of 𝑏 𝛼 (> 0) to corresponding entries of RHS
column. So, those entries will have some reduction by positive numbers. But this is not a
problem as before pivoting these entries of RHS column were all negative any way.

th
Case 2 – There is at least one positive entry in the j column along with corresponding
nonnegative entry in the last column (i.e. RHS column), and w e pivot about aαj
which is negative. So after first requirement of pivoting about aαj, we will get ̅̅̅̅
𝑎𝛼𝑗 = 1
̅̅̅ 𝑏𝛼
and 𝑏 𝛼= > 0. In order to convert all other nonzero entries in the jth column to 0, we
𝑎𝛼𝑗
either add the positive multiples of new version of αth row to other rows or add the negative
multiples of new version of α th row to other rows.

If we are adding the positive multiples of new version of αth row to other rows, then we
̅̅̅
are also adding the same positive multiples of 𝑏 𝛼 (> 0) to corresponding entries of RHS
column. So, those entries will have some more addition of positive numbers. So no danger
of reduction in those values of RHS column.

If we are adding the negative multiples of new version of αth row to other rows, then we
̅̅̅
are also adding the same negative multiples of 𝑏 𝛼 (> 0) to corresponding entries of RHS
column. So, those entries will have some reduction by positive numbers. But this is not a
problem if these RHS entries were negative (before pivoting).

But, if these RHS entries were nonnegative (before pivoting), then we have to show that
these entries will remain nonnegative (after the pivoting). Here goes the proof:

Let m be any such row with 𝑏𝑚 ≥ 0 𝑎𝑛𝑑 𝑎𝑚𝑗 > 0. Then after pivoting
𝑏𝑚 𝑏𝑚 𝑏𝛼
̅̅̅̅ ̅̅̅
𝑏𝑚 = bm – 𝑏 𝛼 𝑎𝑚𝑗 = 𝑎𝑚𝑗 (𝑎
̅̅̅
–𝑏 𝛼 ) = 𝑎𝑚𝑗 (𝑎 – ) ≥ 0, as 𝑎𝑚𝑗 > 0 and
𝑚𝑗 𝑚𝑗 𝑎𝛼𝑗
𝑏𝑚 𝑏𝛼 𝑏 𝑏𝛼
𝑎𝑚𝑗

𝑎𝛼𝑗
. The fact 𝑎 𝑚 ≥ 𝑎𝛼𝑗
is obvious from the fact that we are in this Case 2 due to
𝑚𝑗
𝑏𝛼 𝑏𝑚 𝑏𝛼
the fact that min{ , | 𝑏𝑚 ≥ 0 𝑎𝑛𝑑 𝑎𝑚𝑗 > 0} has occurred at .
𝑎𝛼𝑗 𝑎𝑚𝑗 𝑎𝛼𝑗
th
Case 3 - Rules required us to pivot at some positive entry of the j column, which means
𝑏𝛼 𝑏𝑚
min{ , | 𝑏𝑚 ≥ 0 𝑎𝑛𝑑 𝑎𝑚𝑗 > 0} has occurred at some index m satisfying
𝑎𝛼𝑗 𝑎𝑚𝑗
𝑏𝑘
𝑏𝑚 ≥ 0 𝑎𝑛𝑑 𝑎𝑚𝑗 > 0. Let us call that index m as k. i.e =
𝑎𝑘𝑗

Week 4 Page 11 of 28
𝑏𝛼 𝑏𝑚
min{ , | 𝑏𝑚 ≥ 0 𝑎𝑛𝑑 𝑎𝑚𝑗 > 0}. And we pivot about akj. So after first
𝑎𝛼𝑗 𝑎𝑚𝑗
𝑏𝑘
𝑎𝑘𝑗 = 1 and ̅̅̅
requirement of pivoting about akj, we get ̅̅̅̅ 𝑏𝑘 = 𝑎𝑘𝑗
≥ 0.

Now we have to convert all other nonzero entries in the jth column to 0, for that we
either be adding the positive multiples of new version of kth row to other rows or be adding
the negative multiples of new version of k th row to other rows.
If we are adding the positive multiples of new version of kth row to other rows, then we
are also adding the same positive multiples of ̅̅̅
𝑏𝑘 (≥ 0) to corresponding entries of RHS
column. So, those entries will have some more addition of positive numbers (or no addition
at all). So no danger of reduction in those values of RHS column.

If we are adding the negative multiples of new version of kth row to other rows, then we
are also adding the same negative multiples of ̅̅̅
𝑏𝑘 (≥ 0) to corresponding entries of RHS
column. So, those entries will have some reduction by positive numbers. But this is not a
problem if these RHS entries were negative (before pivoting).
But, if these RHS entries were nonnegative (before pivoting), then we have to show that
these entries will remain nonnegative (after the pivoting). Here goes the proof:

Let m be any such row with 𝑏𝑚 ≥ 0 𝑎𝑛𝑑 𝑎𝑚𝑗 > 0. Then after pivoting
𝑏 𝑏 𝑏
𝑏𝑚 = bm – ̅̅̅
̅̅̅̅ 𝑏𝑘 𝑎𝑚𝑗 = 𝑎𝑚𝑗 (𝑎 𝑚 – ̅̅̅
𝑏𝑘 ) = 𝑎𝑚𝑗 (𝑎 𝑚 – 𝑎 𝑘 ) ≥ 0, as 𝑎𝑚𝑗 > 0 and
𝑚𝑗 𝑚𝑗 𝑘𝑗
𝑏𝑚 𝑏𝑘 𝑏 𝑏𝑘
𝑎𝑚𝑗

𝑎𝑘𝑗
. The fact 𝑎 𝑚 ≥ 𝑎𝑘𝑗
is obvious from the fact that we are in this Case 3 due to
𝑚𝑗
𝑏𝛼 𝑏𝑚 𝑏𝑚
the fact that min{ , | 𝑏𝑚 ≥ 0 𝑎𝑛𝑑 𝑎𝑚𝑗 > 0} has occurred at for some m,
𝑎𝛼𝑗 𝑎𝑚𝑗 𝑎𝑚𝑗
𝑏𝑚 𝑏𝑘
which we have designated as k, so ≥ .
𝑎𝑚𝑗 𝑎𝑘𝑗
𝑎𝑖𝑗 𝑎𝑖𝑗
And finally after pivoting 𝑏̅𝑖 = bi – ̅̅̅
𝑏𝑘 𝑎𝑖𝑗 = bi – b k ≥ bi as bk ≤ 0. So 𝑏̅𝑖 ≥ bi .
𝑎𝑘𝑗 𝑎𝑘𝑗
Note in case of 1 and 2, bi changes from negative to positive a big achievement. In case of
3, 𝑏̅𝑖 ≥ bi. If bk > 0, then 𝑏̅𝑖 > bi, so bi keeps getting larger, and we will eventually get
bi ≥ 0, and be one coefficient closer to having all bi ≥ 0.
We can say that here we are partially optimizing the b i, we say partially optimizing
as we just like to bring it to a nonnegative value from negative value only. Once it is
nonnegative, we terminate as there is no point in making it positive or more positive.

Week 4 Page 12 of 28
1. Semi Standard form:
maximize p = x1 – x2 maximize p = x1 – x2
subject to: 6x1 – x2  10 subject to: 6x1 – x2 + x4 = 10
x1 + 5x2  4 –x1 – 5x2 + x5 = –4
x1 + 5x2 + x3 = 5 x1 + 5x2 + x3 = 5
x1  0, x2  0, x3  0 xi  0 for all i

x1 x2 x3 x4 x5 RHV ratio
x4 | 6 -1 0 1 0 | 10 | -
x5 | -1 (-5) 0 0 1 | -4 | 0.8 (min)
x3 | 1 5 1 0 0 | 5 | 1
|------------------------|
p | -1 1 0 0 1 | 0 |

x1 x2 x3 x4 x5 RHV ratio
x4 |(31/5) 0 0 1 -1/5 | 54/5 | 54/31
x2 | 1/5 1 0 0 -1/5 | 4/5 | 4
x3 | 0 0 1 0 1 | 1 | -
|---------------------------|
p |-6/5 0 0 0 1/5 | -4/5 |
Switching now to phase II:

x1 x2 x3 x4 x5 RHV
x1 | 1 0 0 5/31 -1/31 | 54/31|
x2 | 0 1 0 -1/31 -6/31 | 14/31|
x3 | 0 0 1 0 1 | 1 |
|-------------------------------|
p | 0 0 0 6/31 5/31 | 40/31|
So – Optimality has been achieved. Optimal answer is in the above tableau.

Week 4 Page 13 of 28
2. Maximize P = x1 + x2 + 2x3 – x4
subject to – x1 + x3 + 2x4 ≤ – 3
– x1 + x2 ≤–7
– x 1 + 2x 2 + x4 ≤ – 5
x1, x2, x3, x4 ≥ 0

 b_var x1 x2 x3 x4 x5 x6 x7 RHV
x5 –1 0 1 2 1 0 0 –3
x6 (–1) 1 0 0 0 1 0 –7
x7 –1 2 0 1 0 0 1 –5
P –1 –1 –2 1 0 0 0 0

 b_var x1 x2 x3 x4 x5 x6 x7 RHV
x5 0 –1 1 2 1 –1 0 4
x1 1 –1 0 0 0 –1 0 7
x7 0 1 0 1 0 –1 1 2
P 0 –2 –2 1 0 –1 0 7

Phase I has been terminated successfully. Column x6 shows that problem is feasible but
unbounded. In fact, the ray along which the objective goes towards infinity is
given by:
x1 = 7 + x6
x5 = 4 + x6,
x7 = 2 + x6,
x2 = x3 = x4 = 0,
P = 7 + x6.

As x6 →  , P also →  while all variables remain in the feasible range.


3. Maximize P = x1 + x2 + x3
subject to x1 + 2x2 + 3 x3  2
x2 + 2x3  2
x1 + x2 + x3 = 1
x1  0, x2  0, x3  0.
Week 4 Page 14 of 28
Corresponding tableau of phase I is given by:

 b_var x1 x2 x3 x4 x5 RHV
x4 1 2 3 1 0 2
x5 0 –1 –2 0 1 –2
? (1) 1 1 0 0 1
P –1 –1 –1 0 0 0

 b_var x1 x2 x3 x4 x5 RHV
x4 0 (1) 2 1 0 1
x5 0 –1 –2 0 1 –2
x1 1 1 1 0 0 1
P 0 0 0 0 0 1

 b_var x1 x2 x3 x4 x5 RHV
x2 0 1 2 1 0 1
x5 0 0 0 1 1 –1
x1 1 0 –1 –1 0 0
P 0 0 0 0 0 1
Phase I has been terminated showing that LP is infeasible due to second row.

More on infeasibility: - The second row means x4 + x5 = –1 which is impossible.


Now look at the first constraint, x1 +2x2+ 3x3  2 ⇔ x1+x2+x3+x2+2x3  2⇔
1 + x2 + 2x3  2 (due to third constraint) ⇔ x2 + 2x3  1 and this contradicts
the middle constraint x2 + 2x3  2. So, LP is infeasible.

4. Maximize P = 5x1 – 3x2 + 10 subject to

x1 + 4x2 = 15,
2x1 + 5x2 – 4,
2x1 – 3x2 6,
x 1, x 2 0.

Week 4 Page 15 of 28
 b_var x1 x2 x3 x4 RHV
? (1) 4 0 0 15
x3 –2 –5 1 0 4
x4 –2 3 0 1 –6
P –5 3 0 0 10

 b_var x1 x2 x3 x4 RHV
x1 1 4 0 0 15
x3 0 3 1 0 34
x4 0 11 0 1 24
P 0 23 0 0 85
The phase I is terminated. No need of phase II as the tableau is
already optimal.
5. Maximize – 3x1 – 2x2
subject to
x1 – x2 ≤ –3
– 2x1 – x2 ≤ –5
– 2x2 ≤ –1
– x1 – 4x2 ≤ 0
x1, x2 ≥ 0
 b_var x1 x2 x3 x4 x5 x6 RHV
x3 1 –1 1 0 0 0 –3
x4 –2 (–1) 0 1 0 0 –5
x5 0 –2 0 0 1 0 –1
x6 –1 –4 0 0 0 1 0
P 3 2 0 0 0 0 0
 b_var x1 x2 x3 x4 x5 x6 RHV
x3 (3) 0 1 –1 0 0 2
x2 2 1 0 –1 0 0 5
x5 4 0 0 –2 1 0 9
x6 7 0 0 –4 0 1 20
P –1 0 0 2 0 0 –10
Week 4 Page 16 of 28
Switching now to phase II:

 b_var x1 x2 x3 x4 x5 x6 RHV
x1 1 0 1/3 –1/3 0 0 2/3
x2 0 1 –2/3 –1/3 0 0 11/3
x5 0 0 –4/3 –2/3 1 0 19/3
x6 0 0 –7/3 –5/3 0 1 46/3
P 0 0 1/3 5/3 0 0 –28/3
This tableau is optimal.

6. Maximize x1 + x2
subject to
x 1 + 2x 2 ≤ 8
3x1 + 2x2 ≤ 12
x1 + 2x2 ≥ 13
x1, x2 ≥ 0

 b_var x1 x2 x3 x4 x5 RHV
x3 1 (2) 1 0 0 8
x4 3 2 0 1 0 12
x5 –1 –2 0 0 1 –13
P –1 –1 0 0 0 0
 b_var x1 x2 x3 x4 x5 RHV
x2 1/2 1 1/2 0 0 4
x4 2 0 –1 1 0 4
x5 0 0 1 0 1 –5
P –1/2 0 1/2 0 0 4

Now we have an entry of –5 (i.e. the current value of x5 is negative), but no


other entry in x5 row is negative, which means the problem is infeasible. Note
that the entries in x5 row means: x3 + x5 = –5, an obvious contradiction. So the
LP is infeasible.

Week 4 Page 17 of 28
Note: - First and third constraints are x1 + 2x2 + x3 = 8 and x1 + 2x2 – x5 = 13,
and if you subtract second equation from first you get x3 + x5 = –5. Which is a
contradiction. So LP is infeasible. The infeasibility is also obvious from the fact
that for x1 + 2x2 ≤ 8 and x1 + 2x2 ≥ 13 means x1 + 2x2 should be less than or
equal to 8 and at the same time should be greater than or equal to 13. Which is
a contradiction. So LP is infeasible.
Remark: - Before embarking on the phase I simplex method, an intelligent
student would immediately detect the infeasibility just by looking at the two
obviously contradicting constraints as explained above. Sometimes the
infeasibility is not so obvious as learned from example 3 above. Here is another
such example.

7. Maximize x1 + x2
subject to
x 1 + 2x 2 ≤ 8
3x1 + 2x2 ≤ 12
x1 + 3x2 ≥ 13
x1, x2 ≥ 0

 b_var x1 x2 x3 x4 x5 RHV
x3 1 (2) 1 0 0 8
x4 3 2 0 1 0 12
x5 –1 –3 0 0 1 –13
P –1 –1 0 0 0 0
 b_var x1 x2 x3 x4 x5 RHV
x2 1/2 1 1/2 0 0 4
x4 2 0 –1 1 0 4
x5 1/2 0 3/2 0 1 –1
P –1/2 0 1/2 0 0 4

Again we have an entry of –1 (i.e. the current value of x5 is negative), but no


other entry in x5 row is negative, which means the problem is infeasible. Note

Week 4 Page 18 of 28
that the entries in x5 row means: 0.5x3 + 1.5x5 = –1, an obvious contradiction.
So the LP is infeasible.
Now look at the constraint, x1 + 2x2 ≤ 8. Which means x2 ≤ 4. When we add
x1 + 2x2 ≤ 8 and x2 ≤ 4, we get x1 + 3x2 ≤ 12 which contradicts the third
constraint x1 + 3x2 ≥ 13.

Finally, if you try to solve this problem graphically, you can see below that the
corresponding feasible region is empty.

8. Solve the following linear programming problem:

Maximize = –x1 + 2x2 + x3 + x4


subject to x 1 + x2 + x3 – x4 + x5 = 4
2x1 + x2 – x3 + 3x4 – x6 = 6
2x1 + x2 – x3 + 8x4 + x7 = 10
x1 ≥ 0, x2 ≥ 0, x3 ≥ 0, x4 ≥ 0, x5 ≥ 0, x6 ≥ 0, and x7 ≥ 0.

Week 4 Page 19 of 28
Answer:- The optimal tableau is:
 b_var x1 x2 x3 x4 x5 x6 x7 RHV
x2 10/9 1 7/9 0 8/9 0 1/9 14/3
x4 1/9 0 –2/9 1 –1/9 0 1/9 2/3
x6 –5/9 0 10/9 0 5/9 1 4/9 2/3
z 10/3 0 1/3 0 5/3 0 1/3 10
Practice with the 2-phase method using artificial variables.
We have solved these problems above by non-artificial variables. We are again
solving them by using artificial variables. Students can compare the two
methods and decided which one is better!

Maximize P = X1 + X2 + 2X3 – X4

subject to – X1 + X3 + 2 X4 ≤ – 3

– X1 + X2 ≤ –7
– X1 + 2 X2 + X4 ≤ – 5
X1, X2, X3, X4 > = 0
Solution:- Here we first like to make the right hand values positive. Then we
need to subtract surplus variables (call them X5, X6, X7). After that we need
three artificial variables (call them X8, X9, X10). So constraints are now:
X1 – X3 – 2X4 – X5 + X8 =3
X1 – X2 – X6 + X9 =7
X1 – 2X2 – X4 – X7 + X10 = 5
Phase I of the simplex method requires that we maximize P’ = – (X8 + X9 +
X10). Since X8, X9, and X10 are basic variables here, we need to replace them by
non-basic variables. One way is to add above three equations and then find the
value of – (X8 + X9 + X10) in terms of other variables (which are non-basics).
But there is another way of accomplishing the same thing. Just write P’ row in
terms of basic variables (at the end of the tableau) and then pivot these variables
out before starting phase I.
We may also recall from the previous lecture that in order to start phase II we
have to write the original objective function in terms of the non-basic variables
of the last optimal tableau of phase I (in which P’ = 0). Again this can be
avoided, provided we also keep a row (second from the bottom) corresponding
Week 4 Page 20 of 28
to the original objective function P and also apply the pivoting strategy to this
row as well.
So we start with the following tableau:
 X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 RHV
b_var
X8 1 0 –1 –2 –1 0 0 1 0 0 3
X9 1 –1 0 0 0 –1 0 0 1 0 7
X10 1 –2 0 –1 0 0 –1 0 0 1 5
P –1 –1 –2 1 0 0 0 0 0 0 0
P’ 0 0 0 0 0 0 0 1 1 1 0

We subtract first three rows from the last row to get:

 X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 RHV Ratio


b_var
X8 (1) 0 –1 –2 –1 0 0 1 0 0 3 3(min)
X9 1 –1 0 0 0 –1 0 0 1 0 7 7
X10 1 –2 0 – 1 0 0 –1 0 0 1 5 5
P –1 –1 –2 1 0 0 0 0 0 0 0 –
P’ –3 3 1 3 1 1 1 0 0 0 –15 –
Our next tableau would be (observe X8 column is missing):
 X1 X2 X3 X4 X5 X6 X7 X9 X10 RHV ratio
b_var
X1 1 0 –1 –2 –1 0 0 0 0 3 –
X9 0 –1 1 2 1 –1 0 1 0 4 2
X10 0 –2 1 (1) 1 0 –1 0 1 2 2(min)
P 0 –1 –3 –1 –1 0 0 0 0 3 –
P’ 0 3 –2 –3 –2 1 1 0 0 –6 –

Our next tableau would be (observe X10 column is missing):
 X1 X2 X3 X4 X5 X6 X7 X9 RHV ratio
b_var
X1 1 –4 1 0 1 0 –2 0 7 –
X9 0 (3) –1 0 –1 –1 2 1 0 0(min)
X4 0 –2 1 1 1 0 –1 0 2 –
P 0 –3 –2 0 0 0 –1 0 5 –
P’ 0 –3 1 0 1 1 –2 0 0 –

Week 4 Page 21 of 28

Our next tableau would be the starting tableau of phase II (observe X9 column
P’ row is missing):

 X1 X2 X3 X4 X5 X6 X7 RHV Ratio
b_var
X1 1 0 –1/3 0 –1/3 –4/3 2/3 7 –
X2 0 1 –1/3 0 –1/3 –1/3 2/3 0 –
X4 0 0 (1/3) 1 1/3 –2/3 1/3 2 6(min)
P 0 0 –3 0 –1 –1 1 5 –

Our next tableau would be:
 X1 X2 X3 X4 X5 X6 X7 RHV Ratio
b_var
X1 1 0 0 1 0 –2 1 9 –
X2 0 1 0 1 0 –1 1 2 –
X3 0 0 1 3 1 –2 1 6 –
P 0 0 0 9 2 –7 4 23 –

What can you conclude about this problem?

Answer:

The problem is UNBOUNDED. In fact, the ray along which the objective
goes towards infinity is given by:

X1 = 9 + 2X6

X2 = 2 + X6,

X3 = 6 + 2X6,

X4 = X5 = X7 = 0,

P = 23 + 7X6.

As X6 →  , P also →  while all other variables remain in the feasible range.

Week 4 Page 22 of 28
Note:- When we solved this problem above by using no artificial variables, we
came to the same conclusion of unboundedness, but the ray along which the
objective went towards infinity was given by:
X1 = 7 + X6
X5 = 4 + X6,
X7 = 2 + X6,
X2 = X3 = X4 = 0,
P = 7 + X6.
As X6 →  , P also →  while all other variables remain in the feasible range.
This phenomenon is not surprising. When objective goes towards infinity, it
may go through different rays!
Our next example shows how phase I problem detects the infeasibility of the
original problem.

Maximize P = X1 + X2 + X3

subject to X1 + 2X2 + 3X3  2


X2 + 2X3  2
X1 + X2 + X3 = 1

X1  0, X2  0, X3  0.
After adding a slack in first constraint and subtracting an artificial variable from
second constraint we get the following set of constraints:
X1 + 2X2 + 3X3 + X4 =2
X2 + 2X3 – X5 = 2
X1 + X2 + X3 = 1
This suggests that we need 2 artificial variables for the last two constraints.
Corresponding tableau of phase I is given by:

 b_var X1 X2 X3 X4 X5 X6 X7 RHV
X4 1 2 3 1 0 0 0 2
X6 0 1 2 0 –1 (1) 0 2
X7 1 1 1 0 0 0 (1) 1
P’ 0 0 0 0 0 1 1 0
Week 4 Page 23 of 28
Pricing out the last row of the tableau yield:
 X1 X2 X3 X4 X5 X6 X7 RHV Ratio
b_var
X4 1 2 (3) 1 0 0 0 2 2/3(min)
X6 0 1 2 0 –1 1 0 2 1
X7 1 1 1 0 0 0 1 1 1
P’ –1 –2 –3 0 1 0 0 –3 –
After pivoting we get the following tableau:
 X1 X2 X3 X4 X5 X6 X7 RHV
b_var
X3 1/3 2/3 1 1/3 0 0 0 2/3
X6 0 1 0 2/3
X7 0 0 1 1/3
P’ 0 0 0 1 1 0 0 –1
Last row shows that we have reached the optimal tableau of phase I in which
value of P’ is –1. This means that the original problem is infeasible. As a matter
of fact if we subtract the equality constraint from the less than or equal to
constraint we get the inequality X2 + 2X3  1 which contradicts the middle
constraint (namely X2 + 2X3  2)!
Another Example Maximize P = 5x1 – 3x2 + 10 subject to

x1 + 4x2 = 15,
2x1 + 5x2 – 4,
2x1 – 3x2 6,
x1, x2 0.
Solution:- We obtain the following phase I, Linear Programming Problem in
pseudo standard form:

Maximize P’ = – x3 – x6 subject to
x1 + 4x2 + x3 = 15,
– 2x1 – 5x2 + x4 = 4,
2x1 – 3x2 – x5 + x6 = 6,
x1,..., x6 0,

Week 4 Page 24 of 28
where the variables x3 and x6 are artificial. Now our first tableau is:
 X1 X2 X3 X4 X5 X6 RHV
b_var
X3 1 4 (1) 0 0 0 15
X4 –2 –5 0 1 0 0 4
X6 2 –3 0 0 –1 (1) 6
P –5 3 0 0 0 0 10
P’ 0 0 1 0 0 1 0
Subtract first and third row from last row we get:
 X1 X2 X3 X4 X5 X6 RHV ratio
b_var
X3 1 4 1 0 0 0 15 15
X4 –2 – 5 0 1 0 0 4 –
X6 (2) –3 0 0 –1 1 6 3(min)
P –5 3 0 0 0 0 10 –
P’ –3 –1 0 0 1 0 –21 – 
After pivoting, as indicated, we get the following tableau (note X6 column is
missing):
 b_var X1 X2 X3 X4 X5 RHV ratio
X3 0 (5.5) 1 0 0.5 12 
X4 0 –8 0 1 –1 10 –
X1 1 –1.5 0 0 –0.5 3 –
P 0 –4.5 0 0 –2.5 25 –
P’ 0 –5.5 0 0 –0.5 –12 –
After pivoting, as indicated, we get the following tableau (note X3 column and
P’ row are missing):
 b_var X1 X2 X4 X5 RHV Ratio
X2 0 1 0 (1/11) 24/11 
X4 0 0 1 –3/11 302/11 –
X1 1 0 0 –4/11 69/11 –
P 0 0 0 –23/11 383/11 –
Week 4 Page 25 of 28
After pivoting, as indicated, we get the following tableau:
 X1 X2 X4 X5 RHV
b_var
X5 0 11 0 1 24
X4 0 3 1 0 34
X1 1 4 0 0 15
P 0 23 0 0 85
This is an optimal tableau. The optimal solution is given by;
X1 = 15, X2 = 0, X4 = 34 X5 = 24, P = 85. (Note X3 and X6 were artificial
variables).

The Big – M method


As clear from above, to solve a general LP the simplex method has to be applied
twice. There have been several attempts to combine these two phases into a
single problem. The Big – M method is one of them (which is an interesting re-
arrangement of above two phase calculations). The symbol M will be used to
denote an arbitrarily large number. In this form we deal with the artificial
variables by modifying the objective function. Thus in above example, a
maximizing problem in which x3 and x6 are artificial variables we work with the
objective function: P = 5x1 - 3x2 + 10 – M(x3 + x6),

where M is a large positive constant. There is no need to specify in advance how


large it is; instead insist that it is larger than any given competitor, so that for example
M - 7 or M - 63 are each guaranteed to be positive. Note that x3 and x6 are non-
negative, and that we have constructed our auxiliary objective function in which the
coefficient of these artificial variables are arbitrarily small (since M is so large). A
maximum of P is bound to occur when x3 = x6 = 0, unless the original problem does
not have a feasible solution. We thus set the problem up as follows:

 b_var X1 X2 X3 X4 X5 X6 RHV ratio


X3 1 4 (1) 0 0 0 15 –
X4 –2 –5 0 1 0 0 4 –
X6 2 –3 0 0 –1 (1) 6 –
P –5 3 M 0 0 M 10 –

Week 4 Page 26 of 28
After pivoting as indicated we get the following tableau:

 b_var X1 X2 X3 X4 X5 X6 RHV ratio


X3 1 4 1 0 0 0 15 15
X4 –2 –5 0 1 0 0 4 –
X6 (2) –3 0 0 –1 1 6 3(min)
P –5–3M 3–M 0 0 M 0 10–21M –

After pivoting as indicated we get the following tableau (note X6 column is


missing):

 b_var X1 X2 X3 X4 X5 RHV ratio


X3 0 (11/2) 1 0 1/2 12 
X4 0 –8 0 1 –1 10 –
X1 1 –3/2 0 0 –1/2 3 –
P 0 –9/2– 0 0 –5/2 – 25– –
11M/2 M/2 12M


After pivoting as indicated we get the following tableau (note X3 column is
missing):
 X1 X2 X4 X5 RHV ratio
b_var
X2 0 1 0 (1/11) 24/11 
X4 0 0 1 –3/11 302/11 –
X1 1 0 0 –4/11 69/11 –
P 0 0 0 –23/11 383/11 –

After pivoting, as indicated, we get the following tableau:

Week 4 Page 27 of 28
 X1 X2 X4 X5 RHV
b_var
X5 0 11 0 1 24
X4 0 3 1 0 34
X1 1 4 0 0 15
P 0 23 0 0 85
This is an optimal tableau. The optimal solution is given by;

X1 = 15, X2 = 0, X4 = 34, X5 = 24, P = 85. (Note X3 and X6 were artificial


variables).

Week 4 Page 28 of 28

You might also like