You are on page 1of 29

1

CHAPTER 2


LINEAR PROGRAMMING FORMULATION

George Dantzig developed an efficient method, the simplex algorithm, for solving Linear
Programming (LP) Problems. Some of the major application areas to which LP can be
applied are:

1. Blending
2. Production planning
3. Oil refinery management
4. Distribution
5. Financial and economic planning
6. Manpower planning
7. Blast furnace burdening
8. Farm planning

DEFINITIONS:






























For this topic, we let the function
1 2
( , , , )
n
f x x x be Linear Function such that:

1 2 1 1 2 2
( , , , )
n n n
f x x x c x c x c x = + + + ,
where
1 2
, , ,
n
c c c are some constants.
For a linear function f (x
1
, x
2
, , x
n
) and a constant b, the inequalities
f (x
1
, x
2
, , x
n
) s b and f (x
1
, x
2
, , x
n
) > b
are the Linear Inequalities.


A Linear Programming Problem (LP) is an optimization problem for which we do
the following:

1. We attempt to maximize or minimize a linear function of the decision variables.
The function that is to be maximized or minimized is called the Objective
Function.
2. The values of the decision variables must satisfy a set of constraints. Each
constraint must be a linear equation or linear inequality.


The Feasible Region for an LP is the set of all points satisfying all the LPs
constraints and all the LPs sign restrictions.

For a maximization problem, an Optimal Solution to an LP is a point in the feasible
region with the largest objective function value. Similarly, for a minimization
problem, an optimal solution is a point in the feasible region with the smallest
objective function value.

2
MATHEMATICAL FORMULATION OF THE PROBLEM

PRODUCTION ALLOCATION PROBLEM

A manufacturer produces two types of models M
1
and M
2
. Each M
1
model requires 4 hours of
grinding and 2 hours of polishing; whereas each M
2
model requires 2 hours of grinding and 5
hours of polishing. The manufacturer has 2 grinders and 3 polishers. Each grinder works for
40 hours a week and each polisher works 60 hours a week. Profit on an M
1
model is RM 3.00
and on M
2
model is RM 4.00. Whatever is produced in a week is sold in the market. How
should the manufacturer allocate his production capacity to the two types of models so that he
may make the maximum profit in a week?

Solution:

The LP model, as in any O.R model, has three basic components:
(1) Decision variables that we seek to determine
(2) Objective (goal) that we aim to optimize
(3) Constraints (restrictions) that we need to satisfy

The proper definition of the decision variables is and essential first step in the development of
the model. Once done, the task of constructing the objective function and constraints is more
straightforward.

(1) Let x
1
and x
2
be the number of M
1
and M
2
models that the manufacturer decided to
produce per week.

(2) Then his weekly profit (in RM) is given by:

Maximize Z = 3x
1
+ 4x
2

This is in the assumption that he has enough grinders and polishers capacity to
produce these numbers of models.

(3) Now, in order to produce these numbers of models, the total number of grinding hours
needed per week is given by:
4x
1
+ 2x
2

and the total number of polishing hours per week is given by:
2x
1
+ 5x
2
.

Since he does not have more than 80 hours of grinding and 180 hours of polishing, we
must have:
4x
1
+ 2x
2
s 80
2x
1
+ 5x
2
s 180.

Also, it is not possible for the manufacturer to produce a negative number of models,
it is obvious that we must also have

x
1
> 0

and x
2
> 0.

3
Hence the manufacturers allocation problem can be formulated as:











MEDIA SELECTION PROBLEM

The owner of metro sports wishes to determine how many advertisements to place in selected
three monthly magazines A, B, and C. His objective is to advertise in such a way that total
exposure to principle buyers of expensive sports goods is maximized. Percentage of readers
in each magazine is known. Exposure in any particular magazines is the number of
advertisements placed multiplied by the number of principle buyers. The following data may
be used:

Magazine
A B C
Readers 100,000 60,000 40,000
Principle buyers 10% 15% 07%
Cost per advertisement (RM) 5,000 4,500 4,250

The budget amount is at most RM 100,000 for the advertisements. The owner has already
decided that magazine A should have no more than 6 advertisements and that B, and C each
have at least 2 advertisements. Formulate an LP model for the problem.

Solution:
(1) Let x
1
, x
2
, and x
3
denote the desired number of insertions in magazines A, B, and C.

(2) Then the total exposure to principle buyers of the magazine is given by:

Z = 0.10 * 100,000 x
1
+ 0.15 * 60,000 x
2
+ 0.07 * 40,000 x
3


(3) The budging constraints is

5,000 x
1
+ 4,500 x
2
+ 4,250 x
3
s 100,000

and the advertisement constraints are

x
1
s 6, x
2
> 2, x
3
> 2.





Maximize Z = 3x
1
+ 4x
2
Subject to
(i) 4x
1
+ 2x
2
s 80
(ii) 2x
1
+ 5x
2
s 180.
(iii) x
1
, x
2
> 0.

4
Thus an LP model for Metro owners problem is :













GRAPHICAL SOLUTION

Let us return to the Production Allocation Problem. We obtained a mathematical formulation
of the problem as follows:

Maximize
Z = 3x
1
+ 4x
2

Subject to the constraints:
4x
1
+ 2x
2
s 80
2x
1
+ 5x
2
s 180.
x
1
, x
2
> 0.

X
2


C
B

2x
1
+ 5x
2
= 180

4x
1
+ 2x
2
= 80


O A X
1


The feasible solution space is delineated by the line segments joining the corner points O, A,
C and B. Any point within or on the boundary of the space OACB is feasible, in the sense
that it satisfies all the constraints. Because the feasible space OACB consists of infinite
number of points, the need for a systematic procedure to identify the optimum solution is
obvious.
The determination of the optimum solution requires identifying the direction in which the
profit function Z = 3x
1
+ 4x
2
increases as we would like to maximize. We can do so by
assigning arbitrary increasing value to Z.

The optimum solution occurs at C = (2.5, 35) 5 . 147 = Z
Maximize Z = 10,000 x
1
+ 9,000 x
2
+ 2,800 x
3

Subject to
(i) 5,000 x
1
+ 4,500 x
2
+ 4,250 x
3
s 100,000
(ii) x
1
s 6,
(iii) x
2
> 2,
(iv) x
3
> 2.
(v) x
1
, x
2
, x
3
> 0


5

** Note: It is not accidental that the optimum solution occurs at a corner point of the
solution space where two lines intersect. Indeed, if we change the slope of the profit
function Z (by changing its coefficients), we will discover that the optimum solution always
occurs at one of the corner points. This observation is key to the development of the
general simplex algorithm.



FOUR SPECIAL CASES IN LPP

Four special cases and difficulties that arise when solving the LP problems are:

a. Infeasibility
Infeasibility is a condition that arises when there is no solution to a LP problem that satisfies
all of the constraints given. Graphically, it means that no feasible solution region exists a
situation that might occur if the problem was formulated with conflicting constraints.





For instance,
X
1
+ 2X
2
s6
2X
1
+ X
2
s 8
X
1
>

7
X
1
, X
2
> 0













6
b. Unboundedness
Sometimes a linear program will not have a finite solution. This means that in a maximization
problem, for example, one or more solution variables, and the profit can be made infinitely
large without violating any constraints. Graphically, we will note that the feasible region is
open-ended.

For instance,
Max Z = 3X
1
+ 5X
2

X
1
> 5
X
2
s 10
X
1
+ 2X
2
> 10
X
1
, X
2
> 0













c. Redundancy / degeneracy
Redundancy is caused by one or more constraints that do not affect the feasible region.
Basically, redundancy causes no major difficulties in solving LP but one should be able to
identify its occurrence.

For instance,
Max Z = X
1
+ 2X
2

X
1
s 25
X
1
+ X
2
s 20
2X
1
+ X
2
s 30
X
1
, X
2
> 0











7
d. Alternate Optima.
Alternate Optima occurs when the objective functions line runs parallel to one of the
problems constraints.

For instance,
Max Z = 3X
1
+ 2X
2

X
1
s 3
6X
1
+ 4X
2
s 24
X
1
, X
2
> 0















8
TRANSITION FROM GRAPHIC TO ALGEBRAIC METHOD

The ideas conveyed by the graphical LP solution lay the foundation for the development of
the algebraic simplex method. Figure below draws a parallel between the two methods.
























In the graphical method, the solution space is delineated by the half spaces representing the
constraints, and in the algebraic method the solution space is represented by m simultaneous
linear equations and n non negative variables. Since in the algebraic representation the
number of equations m is always less than or equal to the number of variables, i.e. m s n. If m
= n, and the equations are consistent, the system only has one solution; but if m < n, then the
system of equations will yield infinity of solutions. To make the problem tractable, we shall
set n m variables equal to zero and then solve the m equations for the remaining m
variables, which is known as basic feasible solution, the resulting solution is unique,
corresponding to a corner point of the solution space in graphical approach.
9
SAMPLE PROBLEM USING ALGEBRAIC METHOD

Given the following LP,

Max Z = 2x
1
+ 3x
2

subject to
2x
1
+ x
2
s 4
x
1
+ 2x
2
s 5
x
1
, x
2
> 0

Algebraically, the solution space of the LP is represented as
Max Z = 2x
1
+ 3x
2

subject to
2x
1
+ x
2
+ x
3
= 4
x
1
+ 2x
2
+ x
4
= 5
x
1
, x
2,
x
3,
x
4
> 0

The system has m =2 equations and n =4 variables. Thus according to the rule given, the
corner point can be determine algebraically by setting n m = 4 2 = 2 variables equal to
zero (known as non basic variable) and then solving remaining m = 2 variables (known as
basic variables). For example, if we set x
1
= 0 and x
2
= 0, the equations provides the solution
x
3
= 4 and x
4
= 5 or we also can set x
1
= 0 and x
3
= 0, then x
2
= 4 and x
4
= 1.

In general, we have
4
!
2 !( )!
n
n
m m n m
| | | |
= =
| |

\ . \ .
=
4!
2!2!
= 6 basic solutions as shown in table
below

Non Basic
variables
Basic
variables
Basic solution Feasible
Objective
value, z
(x
1,
x
2
) (x
3,
x
4
) (4,5) Yes 0
(x
1,
x
3
) (x
2,
x
4
) (4, -3) No -
(x
1,
x
4
) (x
2,
x
3
) (2.5, 1.5) Yes 7.5
(x
2,
x
3
) (x
1,
x
4
) (2, 3) Yes 4
(x
2,
x
4
) (x
1,
x
3
) (5, -6) No -
(x
3,
x
4
) (x
1,
x
2
) (1, 2) Yes 8 (optimum)

From the table above, we can observe that basic variables (1, 2) yield the max Z value, Z = 8

10
THE SIMPLEX ALGORITHM

The graphical method shows that the optimum LP solution is always associated with a corner
point of the solution space. This result is key to the development of the general algebraic
simplex method for solving any LP model.

Simplex method is accomplished by first converting all the inequality constraints into
equations and then manipulating the resulting equations in a systematic manner.

A main feature of the simplex method is that it solves the LP in iterations. Each iteration
moves the solution to a new corner point that has potential to improve the value of the
objectives function. The process ends when no further improvements can be realized.


LP solution space in equation form

For the sake of standardization, the algebraic representation of the LP solution space is made
with two conditions:
(i) All the constraints (with the exception of the non-negativity restrictions) are
equations with a non-negative right-hand side.
(ii) All the variables are non-negative.


Converting inequalities into equations

In ( s ) constraints, the right-hand side can be thought of as representing the limit on the
availability of a resource, in which case the left-hand side would represent the usage of this
limited resource. The difference between the right-hand side and the left-hand side of the ( s )
constraint thus yield the unused or slack amount of the resource. To convert a ( s ) inequality
to an ( = ) equation, a non-negative slack variable is added to the left-hand side of the
constraint. For example,
24 4 6
2 1
s + x x
Defining
1
s as the slack or unused amount, the constraint can be converted into
0 , 24 4 6
1 1 2 1
> = + + s s x x


In ( > ) constraints, the amount on the left-hand side exceeds the minimum limit representing
a surplus. To convert a ( > ) inequality to an ( = ) equation, a non-negative surplus variable is
subtracted from the left-hand side of the inequality. For example,
1 2
3 5 9 x x + >
Defining
2
s as the surplus amount, the constraint can be converted into
0 , 9 5 3
2 2 2 1
> = + s s x x



The only remaining requirement is for the right-hand side of the resulting equation to be non-
negative. The condition can always be satisfied by multiplying both sides of the resulting
equation by (1), where necessary. For example, the constraints
11
9
2 1
s + x x
is equivalent to the equation
0 , 9
1 1 2 1
> = + + s s x x
Now, multiplying both sides by (1) will render a non-negative right-hand side, as desired
0 , 9
1 1 2 1
> = s s x x


Dealing with unrestricted variable

In all the LP models presented so far, it is stressed that all variables must be restricted to non-
negative variables. There are situations, however, where a variable may assume any real
(positive, zero, or negative) value.
This restriction is one that may easily be circumvented by simple substitution. For example, if
k
x is an unrestricted variable, we may simply substitute

+
=
k k k
x x x where 0 , >
+
k k
x x
For example,
Express the following LP in the standard form
Maximize
1 2
5 4 Z x x = +
Subject to the constraints

0
6 2
24 4 6
2
1
2 1
2 1
>
> +
s +
x
ed unrestrict x
x x
x x


Solution:
Maximize
1 1 2
5( ) 4 Z x x x
+
= +
Subject to the constraints

0 , ,
6 2 ) (
24 4 ) ( 6
2 1 1
2 2 1 1
1 2 1 1
>
= +
= + +
+
+
+
x x x
s x x x
s x x x


12
THE SIMPLEX ALGORITHM

The Simplex Method, also called Simplex Technique, or Simplex Algorithm is an alternative
procedure for solving a linear programming problem in a finite number of steps.

For the solution of any LP problem by simplex algorithm, the existence of an initial basic
feasible solution is always assumed.

Given a LP problem:
max or min Z =
1
n
i i
i
C X
=


Subject to f
i
(X
1
, X
2
, , X
n
) {s ,=,> }b
i ,
i
=
1
,
2
, ..
m

The steps for the computation of an optimum solution are as follows:

Step 1. Check whether the objective function of the given LP problem is to be maximized or
minimized. If it is to be minimized then we convert it into a problem of maximization using
the result

Minimum Z = - Maximum (-Z).


Step 2. Check whether all b
i
(i = 1,2,.,m) are non-negative. If any of them is negative then
multiply the corresponding inequation of the constraints by (1).


Step 3. Convert all the inequations of the constraints to equations by introducing slack and
/or surplus variables in the constraints.

Notes:
Let
1 2
, , ,
n
y y y , represents the decision variables together with added slack or surplus
variables. The standard form of LP problems can then be represented as follow:

max or min Z =
1
n
i i
i
C y
=


Subject to

11 1 1 2 2 1 1
21 1 2 2 2 2 2
1 1 2 2
1 2
, , , 0
n n
n n
m m m n n m
n
d d d y y y b
d y d y d y b
d y d y d y b
y y y
+ + + =
+ + + =
+ + + =
>
or DY=b
13
Step 4. Obtain an initial feasible solution.
As the LP contains m-constraints, we first identify m linearly independent columns from D to
form a mxm matrix, B. We may then get that:

E Y= B
-1
D Y= B
-1
b = X
B
.

Where E = B
-1
D contain at least m linearly independent columns. Each of the column has
only one non-zeros entry with value of one. Choose m numbers of the correspondent
columns variables as basic variables and otherwise as non-basic variables.
We therefore have the initial feasible solution contains Y
B
= X
B
and all non-basic variables
with zero values.

We hence get the following initial simplex tableau:

C
1
C
2


C
n

C
B
Y
B
X
B
y
1
y
2
.

y
n

C
B1

C
B2

:
C
Bm
Y
B1

Y
B2

:
Y
Bm
X
B1

X
B2

:
X
Bm
E
11
E
21
:
E
m1
E
12

E
22

:
E
m2
.
.
.
.
E
1n

E
2n
:
Emn
Z
0
Z
1
- C
1
Z
2
- C
2
. Z
n
- C
n

Note:
1 2
T
B B B B m
Y Y Y Y ( =

denotes the correspondent basic variables.
1 2
T
B B B B m
C C C C ( =

.
B i
C ( 1, 2, , i m = ) denotes the coefficients of variable
B i
Y
in objective function.
1 2
T
j j j m j
E E E E ( =

denote the coefficients of variable y
j
in constraints or simply
the j column of E.

Step 5. Compute the net evaluations of column j (j = 1, 2, m) to be Z
j
C
j
=
T
B
C E
j
- C
j
.

I. If all (Z
j
C
j
) > 0 (min in obj fn case: (Z
j
C
j
) <= 0) then the initial basic
feasible solution X
B
is an optimum basic feasible solution.
II. If at least one (Z
j
C
j
) < 0 (min in obj fn case (Z
j
C
j
) > 0), proceed into the
next step.

Note: The net evaluation measures the change in the objective function value when one unit
of selected variable is included into the basis.

Step 6. If there is more than one negative value in net evaluations, then choose the most
negative of them. The most negative net evaluation refers to the most increase in the
objective function Z when one unit of variable y
j
enters the basic solution vector. Let it be Z
r
-
C
r
for some j = r.

I. If all (i = 1, 2, m), E
i r
s 0 , then there is unbounded solution to the given
problem.
II. If at least one E
i r
> 0, then the corresponding variable y
r
enters the basis Y
B.

14
Step 7. Compute the ratios , 0, 1, 2,...,
B i
i r
i r
X
E i m
E


) =
`

)
and choose the absolute minimum of
them. Let the absolute minimum of these ratios be
B k
k r
X
E
, then the variable Y
B k
will leave the
basis Y
B
. The absolute minimum of these ratios is chosen to reflect the minimum cost
occurred when the variable y
k
leaves the basis Y
B
. The common element E
k r
, which in the k
th

row and the r
th
column is known as the leading element (or pivotal element) of the table.


Step 8. By performing elementary row operations,
(a) Convert the leading element to unity by dividing its row by the leading element itself

k
k
k r
R
R
E
.
and
(b) convert all other elements in its column to zeroes by making use of the relations:

, 1, 2, , ,
i r
i i k
k r
E
R R R i m i k
E
= = or
Note:
R
i
denotes the i
th
-row in tableau.
When solving LP problems using simplex algorithm, use ONLY the row operations as
given ABOVE. WHY?


Step 9. Go to step 5 and repeat the computational procedure until either optimum solution is
obtained or there is indication of an unbounded solution.


SAMPLE PROBLEM

Use the simplex method to solve the following LP:

Maximize
Z = 7x
1
+ 5x
2

Subject to the constraints
x
1
+ 2x
2
s 6
4x
1
+ 3x
2
s 12
x
1
, x
2
> 0.

Solution:

Steps 1 & 2:
We observe that the given LP is that of maximizing the objective function subject to the
given constraints in which the upper limits are non-negative.

15
Step 3:
The inequations of the constraints can be converted into equations by introducing slack
variables s
1
and s
2
.

Standard Form
x
1
+ 2x
2
+ s
1
+ 0 s
2
= 6
4x
1
+ 3x
2
+ 0 s
1
+ s
2
= 12 (1)

then the new objective function is:
Z = 7x
1
+ 5x
2
+ 0.s
1
+ 0.s
2


Step 4:
The set of equation (1) can be written as:


|
|
.
|

\
|
1 0 3 4
0 1 2 1
(
(
(
(

2
1
2
1
s
s
x
x
=
(

12
6
, or DY = b
Since
(

0
1
and
(

1
0
are two linearly independent column vectors of A with each vector having
only an non-zero entry value of 1. we can take B =
|
|
.
|

\
|
1 0
0 1
as a non singular basis sub-
matrix of A.


Notes:










The basic variables are s
1
and s
2
, therefore an obvious basic feasible solution is
X
B
= B
-1
b
=
|
|
.
|

\
|
1 0
0 1
(

12
6
=
(

12
6

X
B
=
(

2
1
s
s
=
(

12
6


Vectors v
1
,v
2
,,v
n
are linearly independent if and only if the vector equation
x
1
v
1
+ x
2
v
2
+ + x
n
v
n
= 0 has only trivial solution i.e. x
1
= x
2
= = x
n
= 0

A square matrix is non singular if and only if its determinant is nonzero.
16
And put it in the first column of the simplex table
Then, compute

E = B
-1
D
=
|
|
.
|

\
|
1 0
0 1
|
|
.
|

\
|
1 0 3 4
0 1 2 1

=
|
|
.
|

\
|
1 0 3 4
0 1 2 1


Column 3 and 4 of E are two linearly independent columns with single non-zero value. We
therefore choose y
3
and y
4
as basic variables. Thus the initial simplex table is

C 7 5 0 0
C
B
Y
B
X
B
y
1
y
2
y
3
y
4
0 y
3
s
1
= 6 1 2 1 0
0 y
4
s
2
= 12 4 3 0 1


Step 5:
Compute
T
B
C E
j
- C
j
(= Z
j
C
j
)
For instance, in the first column,
1 1 1 1
T
B
Z C C E C = = [0, 0]
(

4
1
- 7 = -7
Second column,
2 2 2 2
T
B
Z C C E C = = [0,0]
(

3
2
- 5 = - 5
and repeat the same for third and fourth row.

C 7 5 0 0
C
B
Y
B
X
B
y
1
y
2
y
3
y
4
0 y
3
s
1
= 6 1 2 1 0
0 y
4
s
2
= 12 4 3 0 1
Z = 0 -7 -5 0 0

Step 6:
Now, since more than one column of net evaluations are negative, therefore we choose the
most negative of these: -7, which lies in the column y
1
will enter the basis Y
B
.


17
Step 7:
To select the vector which should leave the basis Y
B
, we compute
1
1
, 0, 1, 2
B i
i
i
X
E i
E


) =
`

)
and
choose the minimum of these ratios, which appear at y
4
row, 12/4 = 3. Thus the vector y
4

leaves the basis. The leading common element is 4, which becomes the leading element for
the next iteration. The leading element has been shown in the table in bold.

C 7 5 0 0
C
B
Y
B
X
B
y
1
y
2
y
3
y
4
0 y
3
s
1
= 6 1 2 1 0
0 y
4
s
2
= 12 4 3 0 1
Z = 0 -7 -5 0 0

Steps 8 & 9:
First Iteration:
Introduce y
1
and drop y
4
from Y
B
. Convert the leading element to unity by dividing that row
by 4 and all other elements of the column y
1
to zero by using the relation given in Step 8.
Compute again the net evaluation Z
j
- C
j
.

C 7 5 0 0
C
B
Y
B
X
B
y
1
y
2
y
3
y
4
0 y
3
s
1
= 3 0 5/4 1 -1/4
7 y
1
x
1
= 3 1 3/4 0 1/4
Z = 21 0 1/4 0 7/4

It is apparent from the table that all new Z
j
- C
j
are non-negative and hence an optimum
solution has been reached. Thus an optimum basic feasible solution to the given LP is
x
1
= 3, x
2
= 0; max Z = 21.
18
Example 1:
Use the simplex method to solve the following LP:
Maximize
1 2 3 4
2 3 5 Z x x x x = + +
Subject to the constraints

1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4
7 3 7 46
3 2 8
2 3 10
, , , 0
x x x x
x x x x
x x x x
x x x x
+ + + s
+ + s
+ + s
>


Solutions
The correspondent standard form of LP problem is

Max
1 2 3 4
2 3 5 Z x x x x = + +
st
1 2 3 4 1
7 3 7 46 x x x x s + + + + =
1 2 3 4 2
3 2 8 x x x x s + + + =
1 2 3 4 3
2 3 10 x x x x s + + + =
1 2 3 4 1 2 3
, , , , , , 0 x x x x s s s >


C 2 1 -3 5 0 0 0

Iteration C
B
X
B
x
1
x
2
x3 x
4
s
1
s
2
s
3
Ratio
Row Ops
1
0 s
1
= 46 1 7 3 7 1 0 0 46/4 = 6.6
R
1

0 s
2
= 8 3 -1 1 2* 0 1 0 8/2 = 4
R
2

0 s
3
= 10 2 3 -1 1 0 0 1
R
3

Z' = 0 -2 -1 3 -5 0 0 0

2
0 s
1
= 18 -19/2 21/2* -1/2 0 1 -7/2 0
18/(21/2) =
12/7
R
1
7R
2

5 x
4
= 4 3/2 -1/2 1/2 1 0 1/2 0 -
R
2
/2
0 s
3
= 6 1/2 7/2 -3/2 0 0 -2 1 6/(7/2)=12/7
R
3
R
2

Z' = 20 11/2 -7/2 11/2 0 0 5/2 0

3
1 x
2
=12/7 19/21 1 -1/21 0 2/21 -1/3 0
R
1
/(21/2)
5 x
4
=34/7 41/21 0 10/21 1 1/21 1/3 0
R
2
+R
1
/2
0 s
3
=0 -8/3 0 -4/3 0 -1/3 -5/6 1
R
3
R
1
/3
Z' = 26 26/3 0 16/3 0 1/3 4/3 0


Note:
For simplicity, we may use original variables in simplex table (which is the
combinations of decision variables, added slack or surplus variables).
Except the first iteration, R
i
indicates the i-row of the previous iteration. R
i
represents
the i-row of current iteration.
19
Example 2:
Use the simplex method to solve the following LP:
Minimize
1 2 3 4
5 4 6 8 Z x x x x = +
Subject to the constraints

0 , , ,
10 2 4
8 2 2
40 4 2 2
4 3 2 1
4 3 2 1
4 3 2 1
4 3 2 1
>
s +
s + +
s + +
x x x x
x x x x
x x x x
x x x x


Solution

Let
1 2 3 4
' 5 4 6 85 Z Z x x x x = = + +
Consider the following LP problems and correspondent standard form

Max
1 2 3 4
' 5 4 6 85 Z x x x x = + +
st
1 2 3 4 1
2 2 4 40 x x x x s + + + =
1 2 3 4 2
2 2 8 x x x x s + + + =
1 2 3 4 3
4 2 10 x x x x s + + =
1 2 3 4 1 2 3
, , , , , , 0 x x x x s s s >


C -5 4 -6 8 0 0 0

Iteration C
B
X
B
x
1
x
2
x
3
x
4
s
1
s
2
s
3
Ratio
Row Ops
1
0 s
1
= 40 1 2 -2 4 1 0 0 40/4 = 10
R
1

0 s
2
= 8 2 -1 1 2* 0 1 0 8/2 = 4
R
2

0 s
3
= 10 4 -2 1 -1 0 0 1
R
3

Z' = 0 5 -4 6 -8 0 0 0

2
0 s
1
= 24 -3 4* -4 0 1 -2 0
R
1
- 2R
2

8 x
4
= 4 1 -1/2 1/2 1 0 1/2 0
R
2
/2
0 s
3
= 14 5 -5/2 3/2 0 0 1/2 1
R
3
+ R
2

Z' = 32 13 -8 -2 0 0 4 0

3
4 x
2
=6 -3/4 1 -1 0 1/4 -1/2 0
R
1
/4
8 x
4
=7 5/8 0 0 1 1/8 1/4 0
R
2
+ R
1
/2
0 s
3
=29 25/8 0 -1 0 5/8 -3/4 1
R
3
+ 5/2R
1

Z' = 80 7 0 2 0 2 0 0


Min Z = - max Z=-80, and
1 2 3 4
( , , , ) (0, 6, 0, 7) x x x x =

20
Alternate solutions

By choosing non-basic variable with net evaluation in zero level (s
2
) as entering variable, and
x
4
as leaving variable, we get the alternate solution for the problem

C -5 4 -6 8 0 0 0

Iteration CB XB x
1
x
2
x
3
x
4
s
1
s
2
s
3
Ratio
Row Ops
4
4 x
2
=20 1/2 1 -1 2 1/2 0 0
R
1
+ R
2
/2
0 s
2
=28 5/2 0 0 4 1/2 1 0
R
2
*4
0 s
3
=50 5 0 -1 3 1 0 1
R
3
+ 3R
2

Z' = 80 7 0 2 0 2 0 0



Min Z = - max Z=-80, and
1 2 3 4
( , , , ) (20, 0, 0, 0) x x x x =


ARTIFICIAL VARIABLE TECHNIQUES

As demonstrated in previous example, LPs in which all the constraints are ( s ) with non-
negative right-hand side offer a convenient all slack starting basic feasible solution. Models
that involve ( = ) and/or ( > ) constraints do not posses this property.

The procedure for starting ill-behaved LPs with ( = ) and/or ( > ) constraints is to allow
artificial variable to play the role of slacks at the first iteration, and then dispose of them at a
later iteration. Two closely related methods are introduced here:
(i) The Big-M method
(ii) The two-phase method.


THE BIG M-METHOD

The Big M-Method or the method of penalties consists of the following steps:

Step 1. Express the linear programming problem in the standard form by introducing slack
and /or surplus variables.

Step 2. Introduce non-negative variable to the left-hand side of the constraints of (> or =)
type. These variables are called artificial variables. The purpose of introducing these
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. To achieve this, we assign a very large penalty M to these
artificial variables in the objective function for the maximization problem.
21

Step 3. Solve the modified LP by simplex method. At any iteration of the usual simplex
method there can arise any one of the following three cases.

1. There is no vector corresponding to some artificial variable in the X
B
. We
proceed to step 4.
2. There is at least one vector corresponding to some artificial variable in the X
B

at the zero level. The coefficient of M in each net evaluation Z
j
- C
j
is zero.
In such a case, the current basic feasible solution is a degenerate one. This is
the case when an optimum solution to the given LP includes artificial variables
.
3. At least one artificial vector is in the X
B
, but not at the zero level. The
coefficient of M in each net evaluation Z
j
- C
j
is non-negative. In this case,
the given LP doesnt possess an optimum basic feasible solution, since M is
involving in the objective function. In this case we say that the given problem
has a Pseudo Optimum or infeasible basic feasible solution.

Step 4. Application of simplex method is continued until either an optimum basic feasible
solution is obtained or there is indication of unbounded solution.

Theoretically, the application of the Big M implies M . However, using the computer, M
must be finite but sufficiently large. How large is sufficiently large is an open question.
Specifically, M should be large enough to act as penalty. At the same time, it should not be
too large to impair the accuracy of the simplex computations because of manipulating a
mixture of very large and very small numbers.


SAMPLE PROBLEM

Use Big-M method to
Maximize Z = 3x
1
+ 2x
2
+ 3x
3

Subject to the constraints
2x
1
+ x
2
+ x
3
s 2
3x
1
+ 4x
2
+ 2x
3
> 8
x
1
, x
2
, x
3
> 0.


Solution:
Lets introduce the slack, surplus and artificial variables s
1,
s
2,
A

> 0

Standard Form
Maximize Z = 3x
1
+ 2x
2
+ 3x
3
+

0s
1
+ 0s
2
-MA
Subject to the constraints
2x
1
+ x
2
+ x
3
+ 1s
1
+ 0s
2
+ 0A = 2
3x
1
+ 4x
2
+ 2x
3
+ 0s
1
- 1s
2
+ 1A = 8
x
1
, x
2
, x
3
, s
1,
s
2
,A > 0.

X
B
= [s
1
=2 A = 8]


22
Taking B = I
2
as the basic sub-matrix.

Initial Table: The matrix y
B
= [y
1
, y
2
, , y
6
] and the net evaluation Z
j
- C
j
, j = 1,2,,6 are
computed by using the usual formula.

Table 1
3 2 3 0 0 -M
C
B
V
B
X
B
y
1
y
2
y
3
y
4
y
5
y
6
Ratio
0 y
4
s
1
=2 2 1* 1 1 0 0 2/1 =2
-M y
6
A= 8 3 4 2 0 -1 1 8/4 =2
Z =-8M -3M-3 -4M-2 -2M-3 0 M 0

x
2
enters the basis . Since the ratios are the same we can either choose s
1
or A to leave
the basis. We choose s
1
to leave the basis


Table 2
3 2 3 0 0 -M
C
B
V
B
X
B
y
1
y
2
y
3
y
4
y
5
y
6
2 y
2
x
2
=2 2 1 1 1 0 0
-M y
6
A= 0 -5 0 -2 -4 -1 1
Z=4 5M+1 0 2M-1 4M+2 M 0

Since the coefficient of M in each Z
j
-C
j
is strictly non-negative we stop the iteration here.
Although one artificial vector appears in the basis Y
B
, it is at zero level, so it is
acceptable.
The optimum basic feasible solution is: x
1
= 0, x
2
= 2, x
3
= 0, max Z = 4.


Alternatively

If we choose A to leave the basis the Simplex Iterations will be as follows:

Table. 1
3 2 3 0 0 -M
C
B
Y
B
X
B
y
1
y
2
y
3
y
4
y
5
y
6
Ratio
0 y
4
s
1
=2 2 1 1 1 0 0 2/1 =2
-M y
6
A= 8 3 4 * 2 0 -1 1 8/4 =2
Z =-8M -3M-3 -4M-2 -2M-3 0 M 0

x
2
enters the basis and R leaves

23
Table 2
3 2 3 0 0 -M
C
B
Y
B
X
B
y
1
y
2
y
3
y
4
y
5
y
6
Ratio
0 y
4
s
1
= 0 5/4 0 1/2 * 1 1/4 -1/4 0/1/2 =0
2 y
2
x
2
= 2 3/4 1 1/2 0 -1/4 1/4 2/1/2 = 4
Z = 4 -3/2 0 -2 0 -1/2 + M

x
3
enters the basis and s
1
leaves

Table 3
3 2 3 0 0 -M
C
B
Y
B
X
B
y
1
y
2
y
3
y
4
y
5
y
6
3 y
3
x
3
= 0 5/2 0 1 2 1/2 -1/2
2 y
2
x
2
= 2 -1/2 1 0 -1 -1/2 1/2
Z = 4 7/2 0 0 4 1/2 - + M

Since the values in each z
j
-c
j
is strictly non-negative we stop the iterations here.
The optimum basic feasible solution is: x
1
= 0, x
2
= 2, x
3
= 0, max Z = 4.


24
Example 3:
Use Big-M method to solve the following LP problem
Minimize
1 2
4 Z x x = +
Subject to the constraints


0 ,
4 2
6 3 4
3 3
2 1
2 1
2 1
2 1
>
s +
> +
= +
x x
x x
x x
x x


Let
1 2
' 4 Z Z x x = =
Consider the following LP problems and correspondent standard form

Max
1 2 1 2
* 4 Z x x MA MA =
st
1 2 1
3 3 x x A + + =
1 2 1 2
4 3 6 x x s A + + =
1 2 2
2 4 x x s + + =
1 2 1 2 1 2
, , , , , 0 x x s s A A >

C -4 -1 0 0 -M -M

Iteration C
B
X
B
x
1
x
2
s
1
s
2
A
1
A
2
Ratio
Row Ops
1
-M A
1
=3 3* 1 0 0 1 0 3/3=1

-M A
2
=6 4 3 -1 0 0 1 6/4=3/2

0 s
2
=4 1 2 0 1 0 0 4/1=4

Z*=-9M -7M+4 -4M+1 M 0 0 0

2
-4 x
1
= 1 1 1/3 0 0 1/3 0 1/(1/3)=3

-M A
2
=2 0 5/3* -1 0 -4/3 1 2/(5/3)=6/5

0 s
2
=3 0 5/3 0 1 -1/3 0 3/(5/3)=9/5

Z*=-2M-4 0 -5/3M-1/3 M 0 7/3M+4/3 0

3
-4 x
1
=3/5 1 0 1/5 0 3/5 -1/5 (3/5)/(1/5)=3

-1 x
2
=6/5 0 1 -3/5 0 -4/5 3/5 -

0 s
2
= 1 0 0 1* 1 1 -1 1

Z*=-18/5 0 0 -1/5 0 M - 8/5 M + 1/5

4
-4 x
1
=2/5 1 0 0 -1/5 -1/5 0

-1 x
2
=9/5 0 1 0 3/5 -1/5 0

0 s
1
= 1 0 0 1* 1 1 -1

Z*=-17/5 0 0 0 1/5 M+1 M



Min Z = - max Z*=17/5, and
1 2
( , ) (2/ 5, 9/ 5) x x =

25
TWO-PHASE SIMPLEX METHOD

The two-phase simplex method is an alternative method to alleviate the potential adverse
impact of the round off error on the accuracy of the M method where large and small
coefficients are manipulated simultaneously.

In the first phase, the simplex method is applied to special constructed LP leading to a final
simplex table that contains a basic feasible solution to the original problem.

Second phase, leads form the basic feasible solution determined by first phase to an optimum
basic feasible solution if any, by application of simplex method.

Phase I :

Step 1: Express the given LP problem (LPP) in the standard form.

Step 2: Introduce the artificial variables to the constraints of > or = type.

Step 3: Formulate a new objective function Z` by assigning a cost (-1) to each artificial
variable and a cost 0 to all other variables, irrespective of their given cost.
Z` = - A
1
- A
2
- A
3
- . A
k
., where A
i
, i = 1,2, ,k are the added artificial
variables in constraints.

Step 4: Apply simplex method to maximize Z`. There are three cases:

Case(i) : Max Z` < 0 and at least one artificial vector appears in the optimum basis
at a positive level. In this case, there is no feasible solution to the original
LPP.

Case(ii) : Max Z` = 0 , and at least one artificial vector is in the basis at zero level. In
this case, there are two ways to proceed:

a) Find an alternate initial basic feasible solution, if possible. Still in
Phase I, remove the artificial vectors from the basis. This is done by
replacing the artificial variable which is in the basis with a non-basic
variable (not artificial variable) having Z
j
- C
j
= 0. Then proceed to
Phase II.

b) Proceed to Phase II to obtain an optimum basic feasible solution to the
original LPP, but bringing along the artificial vector which is in the
basis. Include the artificial variable in the objective function. The
coefficient for the artificial variable will be 0.

Case(iii) : Max Z` = 0 , and no artificial vector is in the basis.
In this case, basic feasible solution to the original LPP has been obtained.
Proceed to Phase II to obtain an optimum basic feasible solution to the
original LPP.

26
Phase II :

Assign the actual costs to the variables in the objective function and a zero cost to every
artificial variable and apply simplex method. This is equivalent to applying simplex method
to the modified simplex table at the end of Phase I.

SAMPLE PROBLEM

Use two-phase simplex method to
Minimize
Z = 15/2 x
1
3x
2

Subject to the constraints
3x
1
x
2
x
3
> 3
x
1
- x
2
+ x
3
> 2
x
1
, x
2
, x
3
> 0.

Solution:
As usual, since the objective function is to be minimized, we convert it into that of
maximization so that the problem becomes that of maximizing

Z* = - 15/2 x
1
+ 3x
2

Now by introducing surplus variable s
1
, s
2
> 0 and artificial variables A
1
, A
2
> 0 in the
constraints of the given LP, the problem now takes the form:

Standard Form









Phase 1. Assigning a cost (1) to the artificial variables x
6
and x
7
and cost 0 to all other
variables in the objective function,










An initial basic feasible solution to the problem is: [A
1
, A
2
] = [3, 2], with I
2
as the basic
matrix.
MAX Z* = - 15/2 x
1
+ 3x
2


Subject to 3x
1
x
2
x
3
s
1
+ A
1
= 3
x
1
- x
2
+ x
3
s
2
+ A
2
= 2
x
1
, x
2
, x
3,
s
1,
s
2
, A
1,
A
2
> 0.
Maximize Z* = 0x
1
+ 0x
2
+ 0x
3
+ 0x
4
+ 0x
5
1 A
1
1 A
2

Subject to
3x
1
x
2
x
3
- x
4
+ 0x
5
+ A
1
+ 0 A
2
= 3
x
1
x
2
+ x
3
+ 0x
4
x
5
+ 0 A
1
+ A
2
= 2
x
1
, x
2
, x
3,
s
1,
s
2
, A
1,
A
2
> 0..

27

Starting table: After computing the net evaluation z
j
-c
j
, the initial simplex table is:
Table. 1
0 0 0 0 0 -1 -1
C
B
Y
B
X
B
y
1
y
2
y
3
y
4
y
5
y
6
y
7
Ratio
-1 y
6
A
1
=

3 3 * -1 -1 -1 0 1 0 3/3 = 1
-1 y
7
A
2
= 2 1 -1 1 0 -1 0 1 2/1 = 2
Z = -5 -4 2 0 1 1 0 0

Introduce y
1
and drop R
1


Table. 2
0 0 0 0 0 -1 -1
C
B
Y
B
X
B
y
1
y
2
y
3
y
4
y
5
y
6
y
7
Ratio
0 y
1
x
1
=1 1 -1/3 -1/3 -1/3 0 1/3 0
-1 y
7
A
2
=1 0 -2/3 4/3 1/3 -1 -1/3 1
Z = -1 0 2/3 -4/3 -1/3 1 4/3 0

Introduce y
3
and drop A
2
.

Table. 3
0 0 0 0 0 -1 -1
C
B
Y
B
X
B
y
1
y
2
y
3
y
4
y
5
y
6
y
7

0 y
1
x
1 =
5/4 1 -1/2 0 -1/4 -1/4 1/4 1/4
0 y
3
x
3 =
3/4 0 -1/2 1 1/4 -3/4 -1/4 3/4
Z = 0 0 0 0 0 0 1 1

Now since all Z
j
C
j
> 0 and no artificial variable appears in the basis, therefore a basic
feasible solution has been attained.

Therefore we proceed on to phase2.

Phase 2. Here we consider the actual costs associated with the original variables. Then
objective function, therefore is:
Maximize Z* = - 15/2 x
1
+ 3x
2
+ 0x
3
+ 0 s
1
+ 0 s
2
.

Starting table: Using the optimum simplex table of Phase 1, the first simplex table of Phase 2
is as follows:


-15/2 3 0 0 0
C
B
Y
B
X
B
y
1
y
2
y
3
y
4
y
5
-15/2 y
1
x
1 =
5/4 1 -1/2 0 -1/4 -1/4
0 y
3
x
3 =
3/4 0 -1/2 1 1/4 -3/4
Z = -75/8 0 3/4 0 15/8 15/8
However we notice that since all z
j
-c
j
> 0, an optimum basic feasible solution has been
attained. Hence an optimum basic feasible solution to the given LP is:
x
1
= 5/4, x
2
= 0, x
3
= 3/4; Min. Z = - Max Z* = 75/8

28

Example 4:
Use two-phase method to solve the following LP problem
Minimize
1 2
4 Z x x = +
Subject to the constraints

0 ,
4 2
6 3 4
3 3
2 1
2 1
2 1
2 1
>
s +
> +
= +
x x
x x
x x
x x


Solution

Let
1 2
' 4 Z Z x x = =
Consider the following LP problems and correspondent standard form

Max
1 2
' 4 Z x x =
st
1 2 1
3 3 x x A + + =
1 2 1 2
4 3 6 x x s A + + =
1 2 2
2 4 x x s + + =
1 2 1 2 1 2
, , , , , 0 x x s s A A >


Phase 1
We consider the above LP having the following objective function:

Max
1 2
* Z A A =

C 0 0 0 0 -1 -1

Iteration C
B
X
B
x
1
x
2
s
1
s
2
A
1
A
2
Ratio
Row Ops
1
-1 A
1
=3 3* 1 0 0 1 0 3/3=1

-1 A
2
=6 4 3 -1 0 0 1 6/4=3/2

0 s
2
=4 1 2 0 1 0 0 4/1=4

Z*= -9 -7 -4 1 0 0 0

2
0 x
1
= 1 1 1/3 0 0 1/3 0 1/(1/3)=3

-1 A
2
=2 0 5/3* -1 0 -4/3 1 2/(5/3)=6/5

0 s
2
=3 0 5/3 0 1 -1/3 0 3/(5/3)=9/5

Z* = -2 0 -5/3 1 0 7/3 0

3
0 x
1
=3/5 1 0 1/5 0 3/5 -1/5

0 x
2
=6/5 0 1 -3/5 0 -4/5 3/5

0 s
2
= 1 0 0 1* 1 1 -1

Z* = 0 0 0 0 0 1 1


Z* at zero level and no artificial solution in basic feasible solution. Proceed to phase II
29
Phase II
We consider the above LP problem having initial feasible solution from step 1

C -4 -1 0 0

Iteration CB XB x
1
x
2
s
1
s
2
Ratio
Row Ops
1
-4 x
1
=3/5 1 0 1/5 0 (3/5)/(1/5)=3

-1 x
2
=6/5 0 1 -3/5 0 -

0 s
2
= 1 0 0 1* 1 1/1=1

Z' = 0 0 0 -1/5 0

2
-4 x
1
=2/5 1 0 0 -1/5

-1 x
2
=9/5 0 1 0 3/5

0 s
1
= 1 0 0 1* 1

Z = -17/5 0 0 0 1/5


Min Z = - max Z = 17/5,
1 2
( , ) (9/ 5, 2/ 5) x x =

You might also like