You are on page 1of 10

Center for Computer Studies

Institute of Business Administration


Handout # 2
Towards Simplex Method
Last week we were able to solve the following problem graphically:
maximize f(x1, x2) = 200x1 + 400x2
s.t. 3x1 + 2x2 120
x1 + x2 50
xj 0 j = 1, 2 (1)
The graphical method ceases to work for more than two varaibles. In this
handout, we develop a solution approach for arbitraray LP’s with n decision
variables (where n is any positive integer).
Some Terminology
An LP problem is called Standard Maximum Problem (SMP) if it satisfies
the following conditions:
1. The objective function is linear and is to be maximized:
 maximize z = c1x1 + c2x2 + … + cnxn
2. The variables are all nonnegative:
 xj 0 for all j = 1, … , n.
3. Constraints, other than the nonnegative constraints, are of the
form:
 a11x1 + a12x2 + … + a1nxn b1
 a21x1 + a22x2 + … + a2nxn b2
 ………
 ……...
 am1x1 + am2x2 + … + amnxn bm
where b1, b2, … , bm are all non-negative constants.
Slack variable:- A slack variable converts a constraint not of the
nonnegative type (and which involves symbol) into an equality. For example
the slack variables s1, s2, … , sm, converts the above set into the following set:
 a11x1 + a12x2 + … + a1nxn + s1 = b1
 a21x1 + a22x2 + … + a2nxn + s2 = b2
 ………
 ……...

Handout # 2 Page 1 of 10
 am1x1 + am2x2 + … + amnxn + sm = b m
Note:- For any point in the feasible region of a linear programming problem,
the value of each slack variable is either positive or zero. So in above s 1, s2,…,
sm are all non-negative slack variables.
So the method we are going to develop is basically applicable to the following
type of problem (note here b1, b2, … , bm are all non-negative constants):
maximize z = c1x1 + c2x2 + … + cnxn
s.t.
a11x1 + a12x2 + … + a1nxn + s1 = b1
a21x1 + a22x2 + … + a2nxn + s2 = b2
………
……...
am1x1 + am2x2 + … + amnxn + sm = b m

xj 0 for all j = 1, … , n and si 0 for all i = 1, … , m. (2)


An LP problem of above type is called Standard Maximum Problem in
Solvable Form (SMPiSF). This problem can also be written in matrix form
as:
maximize cTx
s.t.
A =b
and x, s 0.
Where x, s are vectors whose entries are variables; c, b are vectors whose
entries are constants. A is a matrix of order m by n + m. It should be observed
that every column of A corresponds to a variable and conversely. These
vectors and matrix A are given by:

x= ,s= ,c= ,b= ,

A= .

Handout # 2 Page 2 of 10
Basic Variables:- A set of m variables are called basic variables of an
SMPiSF if the corresponding set of m columns in A forms a set of m linearly
independent columns.
Non-basic Variables:- A variable which is not a basic variable is called a
non-basic variable.
Basis:- A sub-matrix of order m by m of A whose columns are associated
with m basic variables is called a basis of A (or of LP) and is denoted by B.
Note:- There are many different sets of basic variables. At a given stage we
pick a particular set of basic variables and then rest of variables will be non-
basic variables.
Basic Feasible Solution (BFS):- A solution of SMPiSF is called Basic
Feasible Solution (BFS) if it is a feasible solution of the problem and the
values of all the non-basic variables are zero.
As a matter of fact, a BFS is found by putting all the non-basic variables equal
to zero and then solving the resulting system for basic variables.
In above SMPiSF the obvious basic variables are s1, s2, … , and sm.
Consequently the non-basic variables are x1, x2, … , and xn. With this choice
of basic and non-basic variables we have the extra advantage that the
objective function of SMPiSF consists entirely of non-basic variables (a
crucial point used by the simplex method which we are about to develop).
The corresponding BFS is given by xj = 0 for all j = 1, … , n, and si = bi for
all i = 1, … , m. The value of the objective function at this stage is 0.
From above discussion a reader might get the impression that only from
SMPiSF one can detect a basis. In fact, the argument can also be reversed, i.e.
given a basis; an LP can also be transformed into a SMPiSF (by using
elementary row operations) in which the columns associated with the basic
variables of the basis forms a set of m independent unit columns and the
objective function is free from these variables.
In fact, the simplex method developed by Dantzig starts from a given basis
and reduce the LP into SMPiSF w.r.t this basis. It then calculates the
corresponding BFS and the value of the objective functions. After that it
decides if the current basis is optimal by looking at the signs of the
coefficients of the objective functions. If all the coefficients are non-positive it
is optimal (why?). In case there are positive coefficients the current BFS does
not provide an optimal solution. This is because we can increase the values of
the corresponding variables (currently these are at zero level – as they are
non-basic variables). This will provide a relatively higher value of the
objective function.
Handout # 2 Page 3 of 10
Although we may like to increase more than one variable, the rules of simplex
method say that we should increase only one non-basic variable at a time.
Note that the moment you increase non-basic variable it becomes a basic
variable. But you can not have m+1 basic variables. The number of basic
variables should be exactly m. This simply means the status of one of the
current basic variable must be changed to a non-basic one. How to do this? To
address this and other related issues we consider the problem (1) and solve it
by the simplex method. We first introduce the slack variables s1 and s2 to get
the following equivalent LP which is also an SMPiSF:
maximize f(x1, x2, s1, s2) = 200x1 + 400x2
s.t. 3x1 + 2x2 + s1 = 120
x1 + x2 + s2 = 50
xj 0 j = 1, 2 and si 0 i = 1, 2 (3)
Here we take s1 and s2 as basic variables and x1 and x2 as non-basic variables.
In order to find BFS we put x1 = x2 = 0 in above to get the following system;
s1 = 120
s2 = 50
for basic variables. The solution of this system is simply s 1 = 120, s2 = 50. So
the BFS at this stage is given by, (x 1, x2, s1, s2)T= (0,0,120,50)T. The value of
the objective at this stage is f(x1, x2, s1, s2) = f(0, 0, 120, 50) = 200 x 0 + 400 x
0 = 0.
Is this BFS an optimal one?
The answer is no! This is because at this stage x 1= x2 = 0 but the coefficients
of these variables in the objective are positive (they are respectively 200 and
400). By increasing x1 or x2 or both we can also increase the objective value.
We have the following choices:
 to increase x1
 to increase x2
 to increase both x1 and x2
As already pointed above the rule says we can increase only one variable at a
time. Accordingly, we decide to increase x2 (since its co-efficient is relatively
bigger). We will continue to keep x1 at zero level (i.e. it remains non-basic).
Now that we have decided to increase x2, it is no more a non-basic variable.

Handout # 2 Page 4 of 10
As a matter of fact, it is now basic. Since we can not have three basic
variables, we must convert either s1 or s2 into a non-basic variable. Which one
should be converted into non-basic? Answer to this question and of the
question, how much to increase x2 are related to each other. To answer both
questions we put x1= 0 in system (3) to get the following system:
2x2 + s1 = 120
x2 + s2 = 50
x2 0 and si 0 i = 1, 2 (4)
The first equation says that maximum value of x2 is 60 (beyond that s1 will
become negative). The second equation says that maximum value of x 2 is 50
(beyond that s2 will become negative).
Together it means that x2 can be increased to 50. Note 50 = min {120/2, 50} =
min {60, 50}. Increasing x2 to 50 will make s2 zero. So, we can make s2 a non-
basic variable. This means that x2 and s2 are interchanging their status. This
will always be the case. At a given stage a pair of variables will change their
status.

Since now “new” basic variable is x2, we would like to make column
associated with x2 as , as the column associated with the “old” basic
variable s2 was . Note that we are lucky enough here to have 1, as the
coefficient of x2, in the second equation in system (3). To get o, as the
coefficient of x2, in the first equation in system (3) we add –2 of second
equation to the first equation to get the following system:
(3 – 2)x1 + (2 – 2)x2 + s1 – 2s2 = 120 – 100
x1 + x2 + s2 = 50
Which on simplification becomes:
x1 + + s1 – 2s2 = 20
x1 + x2 + s2 = 50
We finally adjust the objective function f(x1, x2, s1, s2) = 200x1 + 400x2
= 200x1 + 400(50 – x1 – s2) = – 200x1 – 400s2 + 20000.
Hence the equivalent version of the given LP with respect to new basic
variables s1 and x2 in SMPiSF is given by:

Handout # 2 Page 5 of 10
maximize f(x1, x2, s1, s2) = – 200x1 – 400s2 +20000
s.t. x1 + + s1 – 2s2 = 20
x1 + x2 + s2 = 50
xj 0 j = 1, 2 and si 0 i = 1, 2 (5)
The BFS at this stage is given by, (x1, x2, s1, s2)T= (0,50,20,0)T. The value of
the objective at this stage is f(x1, x2, s1, s2) = f(0, 50, 20, 0) = – 200 x 0 – 400 x
0 + 20000 = 20000.
Is this BFS an optimal one?
The answer is yes! This is because at this stage x 1= s2 = 0 but the coefficients
of these variables in the objective are negative (they are respectively –200 and
–400). Increasing either of them will decrease objective value – which is
against the optimality criterion. So the optimal vector is given by (x1, x2, s1,
s2)T= (0,50,20,0)T. The optimum value is 20000. It may be interesting to note
that the first BFS discussed above corresponds to the point A of Figure 1 of
page 6 of week 1 and the second BFS discussed above corresponds to the
point B of the same figure.

Example 2 Solve the following LP by the simplex method:

maximize f(x1, x2) = 5x1 + 4x2


s.t. x1 + 2x2 10
x1 + x2 6
2x1 + x2 10
xj 0 j = 1, 2 (6)

Solution:- We first introduce the slack variables s1, s2, and s3 to get the
following equivalent LP which is also an SMPiSF:
maximize f(x1, x2, s1, s2, s3) = 5x1 + 4x2
s.t. x1 + 2x2 + s1 = 10
x1 + x2 + s2 = 6
2x1 + x2 + s3 = 10
xj 0 j = 1, 2 and si 0 i = 1, 2, 3 (7)

Handout # 2 Page 6 of 10
Here we take s1, s2 and s3 as basic variables & x1 and x2 as non-basic variables.
In order to find BFS we put x1 = x2 = 0 in above to get the following system;
s1 = 10
s2 = 6
s3 = 10
for basic variables. The solution of this system is simply s 1 = 10, s2 = 6 and s3
= 10. So the BFS at this stage is given by, (x 1, x2, s1, s2, s3)T= (0,0,10,6,10)T.
The value of the objective at this stage is f(x 1, x2, s1, s2, s3) = f(0, 0, 10, 6, 10)
= 5 x 0 + 4 x 0 = 0.
Is this BFS an optimal one?
The answer is no! This is because at this stage x 1= x2 = 0 but the coefficients
of these variables in the objective are positive (they are respectively 5 and 4).
By increasing x1 or x2 or both we can also increase the objective value. Since
the rules of simplex method allow us to increase only one variable, we like to
increase the value of the variable x1 (since its co-efficient is relatively bigger).
We will continue to keep x2 at zero level (i.e. it remains non-basic). Now that
we have decided to increase x1, it is no more a non-basic variable. It is now a
basic variable. Since we can not have four basic variables we have to convert
either s1 or s2 or s3 into a non-basic variable. Which one should be converted
into non-basic? Answer to this question and of the question, how much to
increase x1 are related to each other. To answer both of these questions we put
x2 = 0 in system (7) to get the following system:

x1 + s1 = 10
x1 + s2 = 6
2x1 + s3 = 10
x1 0 and si 0 i = 1, 2, 3 (8)

This system clearly says that x1 can be increased up to the min {10/1, 6/1,
10/2} = min {10, 6, 5} = 5. Increasing x1 to 5 will make s3 zero. So we can
make s3 a non-basic variable. This means that x1 and s3 are interchanging their
status. Since now “new” basic variable is x 1, we would like to make the

column associated with x1 as , as the column associated with the “old”

Handout # 2 Page 7 of 10
basic variable s3 was . For that we first divide the third equation in system
(7) by 2 to get the following system (we copy the first two equations as it is
for compactness):
x1 + 2x2 + s1 = 10
x1 + x2 + s2 = 6
x1 + (1/2)x2 + (1/2)s3 = 5
We next subtract third equation from the first two equations to get the
following system:
(3/2)x2 + s1 – (1/2)s3 = 5
(1/2)x2 + s2 – (1/2)s3 = 1
x1 + (1/2)x2 + (1/2)s3 = 5
We finally adjust the objective function f(x1, x2, s1, s2, s3) = 5x1 + 4 x2
= 5(5 – (1/2)x2 – (1/2)s3) + 4x2 = (3/2)x2 – (5/2)s3 + 25.
Hence the equivalent version of the given LP with respect to new basic
variables s1, s2 and x1 in SMPiSF is given by:
maimize f(x1, x2, s1, s2, s3) = (3/2)x2 – (5/2)s3 + 25
s.t. (3/2)x2 + s1 – (1/2)s3 = 5
(1/2)x2 + s2 – (1/2)s3 = 1
x1 + (1/2)x2 + (1/2)s3 = 5
xj 0 j = 1, 2 and si 0 i = 1, 2, 3 (9)
Note, the BFS here is (x1, x2, s1, s2, s3)T= (5, 0, 5, 1, 0)T. The value of the
objective at this stage is f(x1, x2, s1, s2, s3) = f(5, 0, 5, 1, 0) = (3/2) x 0 – (5/2)
x 0 + 25 = 25.
Is this BFS an optimal one?
The answer is no! This is because at this stage x 2 = s3 = 0 but the coefficient of
x2 in the objective is positive. By increasing x2 we can also increase the
objective value. Since the other non-basic variable s3 will remain non-basic
variable in future as well, we let s3 = 0 in system (9) above to get the folowing
system:
(3/2)x2 + s1 = 5
(1/2)x2 + s2 = 1
x1 + (1/2)x2 = 5
xj 0 j = 1, 2 and si 0 i = 1, 2
This system clearly says that x2 can be increased up to the min {5/3/2, 1/1/2,
5/1/2} = min {10/3, 2, 10} = 2. Increasing x 2 to 2 will make s2 zero. So we can
make s2 a non-basic variable. This means that x2 and s2 are interchanging their
Handout # 2 Page 8 of 10
status. Since now “new” basic variable is x 2, we would like to make the

column associated with x2 as , as the column associated with the “old”

basic variable s2 was . For that we first multiply the second equation in
system (9) by 2 to get the following system (we copy the other two equations
as it is for compactness):
(3/2)x2 + s1 – (1/2)s3 = 5
x2 + 2s2 – s3 = 2
x1 + (1/2)x2 + (1/2)s3 = 5
We next multiply the middle equation respectively by 3/2 and 1/2 and subtract
them from first and last equation to get the following system:
s1 – 3s2 + s3 = 2
x2 + 2s2 – s3 = 2
x1 + – s 2 + s3 = 4
We finally adjust the objective function f(x1, x2, s1, s2, s3) = (3/2)x2 – (5/2)s3 +
25 = (3/2)(2 – 2 s2 + s3) – (5/2)s3 + 25 = – 3s2 – s3 + 28
Hence the equivalent version of the given LP with respect to new basic
variables s1, x2, and x1, in SMPiSF is given by:
maimize f(x1, x2, s1, s2, s3) = – 3s2 – s3 + 28
s.t. s1 – 3s2 + s3 = 2
x2 + 2s2 – s3 = 2
x1 + – s 2 + s3 = 4 (10)
T T
Note, the BFS here is (x1, x2, s1, s2, s3) = (4, 2, 2, 0, 0) . The value of the
objective at this stage is f(x1, x2, s1, s2, s3) = f(4, 2, 2, 0, 0) = – 3 x 0 – 0 + 28
= 28.
Is this BFS an optimal one?
The answer is yes! This is because at this stage s 2 = s3 = 0 but the coefficients
of these variables in the objective are negative (they are respectively –3 and
–1). Increasing either of them will decrease objective value – which is against
the optimality criterion. So the optimal vector is given by (x1, x2, s1, s2, s3)T=
(4, 2, 2, 0, 0)T. The optimum value is 28.
It may be illuminating here to compare the above solution with the graphical
solution. The feasible region of the given LP together with a table containing
all the corner points is given below:

Handout # 2 Page 9 of 10
(0, 5)
Serial Corner Value of the
No Points objective (2, 4)
function
1) (0,0) 0
2) (5,0) 25 (4, 2)
3) (4,2) 28
4) (2,4) 26 feasible region
5) (0,5) 20
(5, 0)

Here simplex method started its journey from (0, 0) and stops at (4, 2) with an
intermediate stop at the point (5, 0). Had we decided to increase x2, instead of
increasing x1 we would end up with the same optimal point (4, 2); the only
difference would be that instead of one intermediate point we had to visit two
intermediate points, namely (0, 5) and (2, 4).
From above example it is clear that during all the calculations we have carried
out all the variables with us. In fact there is no need for that. All we need is to
carry the coefficients of the variables only. But that requires an (implicit)
understanding of what co-efficient belongs to which variable.
This can easily be done with the help of canonical tableaus. Just wait for the
handout # 3.

Handout # 2 Page 10 of 10

You might also like