Lecture 4: The Simplex Method
Lecture 4: The Simplex Method
Lecture 4: The Simplex Method
Definition 4.1.1. For any LP with m constraints, two basic feasible solutions are said to be
adjacent if their sets of basic variables have m − 1 basic variables in common.
Intuitively, two basic feasible solutions are adjacent if they both lie on the same edge
of the boundary of the feasible region.
The simplex method finds the optimal solution by moving from one basic feasible solu-
tion to an adjacent basic feasible solution which increases objective function value (for Max
Problem) in each step.
Max z = cT x
Subject to Ax = b
x≥0
Recall that a basic feasible solution to this problem corresponds to an extreme point
of the feasible region and is characterised mathematically by partitioning matrix A into a
nonsingular matrix B and the matrix of nonbasic columns N. That is
A = [B, N]
BxB + NxN = b
B−1 b
xB
x= =
xN 0
4-1
Lecture 4: The Simplex Method 4-2
is called a basic solution, with vector xB called the vector of basic variables, and xN is called
the vector of nonbasic variables. If, in addition, xB ≥ 0, then
−1
B b
x=
0
is called a basic feasible solution.
Now consider the objective function z = cT x. Partitioning the cost vector c into basic
and nonbasic components (i.e., cT = (cTB , cTN )), the objective function can be recast as
z = cTB xB + cTN xN
= cTB (B−1 b − B−1 NxN ) + cTN xN
= cTB B−1 b − (cTB B−1 N − cTN )xN
The canonical representation forms the foundation upon which the simplex method is
built.
Now, rearranging terms so that all the variables are on the left-hand side of the equa-
tion, we have
The simplex tableau is simply a table used to store the coefficients of the algebraic rep-
resentation in (4.3-4.4). The body of the tableau (row 1 to row m) records the coefficients
of the constraint equation (4.4), and the bottom row (row 0) of the tableau consist of the
coefficients in the objective equation (4.3).
z xN xB RHS
xB 0 B−1 N I B−1 b (rows 1- m)
z 1 cTB B−1 N − cTN 0T cTB B−1 b (row 0)
Lecture 4: The Simplex Method 4-3
x RHS
xB B−1 A B−1 b (rows 1- m)
z cTB B−1 A − cT cTB B−1 b (row 0)
Now letting J be the index set of the nonbasic variables, the canonical representation
can be rewritten as follows:
X
z = cTB B−1 b − (cTB B−1 aj − cj )xj (4.5)
j∈J
X
xB = B−1 b − (B−1 aj )xj (4.6)
j∈J
The quantity (cTB B−1 aj − cj ) is sometimes referred to as the reduced cost and for con-
venience is usually denoted by (zj − cj ).
Now let
β1
β2
B−1 b = β = .
..
βm
x1 x2 xn RHS
xB,1 y1,1 y1,2 ··· y1,n β1
xB,2 y2,1 y2,2 ··· y2,n β2
.. .. .. .. .. ..
. . . . . .
xB,m ym,1 ym,2 ··· ym,n βm
z z1 − c1 z2 − c2 ··· zn − cn cTB β
where
y1,k
y2,k
yk = . = B−1 ak k = 1, 2, . . . , n (4.7)
.
.
ym,k
Lecture 4: The Simplex Method 4-4
Recall from the previous section that adjacent extreme points differ by exactly one
basic and nonbasic variable. The central idea behind the simplex method is to move from
an extreme point to an improving adjacent extreme point by interchanging a column of B
and N.
In the current basic feasible solution xN = 0, that is, the nonbasic variables are at their
lower bound and can only be increased from their current value of zero. Observe that the
coefficient −(cTB B−1 aj − cj ) of xj in (4.5) represents the rate of change of z with respect to
the nonbasic variable xj . Thus, if −(cTB B−1 aj − cj ) = −(zj − cj ) > 0, then increasing xj
will increase z.
B−1 b
xB
The basic feasible solution x = = will be optimal if
xN 0
or, equivalently, if
zj − cj = cTB B−1 aj − cj ≥ 0, for all j ∈ J
Remark
1. Because zj − cj = 0 for all basic variables, then the optimality conditions could also
be stated simply as zj − cj ≥ 0, for all j = 1, 2, . . . , n.
2. If zj − cj > 0, for all j ∈ J, then the current basic solution will be the unique optimal
solution.
Suppose there exists some nonbasic variable xk with a reduced cost zk − ck < 0. Then
the objective function can be improved (increased) by increasing xk from its current value
of zero. This xk is called the entering variable. That is, xk is going to enter the basic vector.
To maintain a basic vector with m components, we must exchange it for some variable that
is currently basic; this variable is called departing variable. Mathematically, we need to form
a new basis by exchanging ak with some column of the current basis matrix B.
Let us now investigate the consequences of the preceding results. Consider the vector
of coefficients of the nonbasic variable xk in (4.6) and let
yk = B−1 ak (4.8)
Lecture 4: The Simplex Method 4-5
Thus, (4.9) identifies that, in fact, the elements of yk specify how to write ak as a linear
combination of the columns of B. Therefore, ak may be exchanged with any column bj of
B for which yj,k 6= 0.
Second, if the nonbasic variable xk is increased from its current value of zero while
holding all other nonbasic variables at zero, then the basic variables will change according
to the relationship
Now let
β1
β2
B−1 b = β = .
..
βm
β1 y1,k
β2 y2,k
− x k . ≥0
..
. ..
βm ym,k
βi βr
xk ≤ min | yi,k > 0 =
yi,k yr,k
This process is termed the minimum ratio test and provides a very simple method for
determining the maximum value of the entering variable. Essentially, we are finding the
smallest value of the entering variable xk , which results in a basic variable (xB,r ) assuming
the value zero. The basic variable that is forced to be zero as a result of the increase in xk
is called the departing variable.(That is, it departs or leaves the basic vector.)
Lecture 4: The Simplex Method 4-6
Pivot Operation
A new canonical representation is derived by solving for z and the new set of basic
variables in terms of the new set of nonbasic variable. This process is called pivot and
results in a new canonical representation. This process can simply be demonstrated using
tableau. yr,k is called the pivot element, row r is called the pivot row, column k is called
the pivot column. Use elementary row operations on the old tableau so that the column
associated with xk in the new tableau consists of all zero elements except for a 1 at the
pivot position yr,k .
k j k j
r ∗
yr,k yr,j becomes r 1 yr,j /yr,k
i yi,k yi,j i 0 yi,j − yi,k yr,j /yr,k
We are now ready to summarize the steps of the simplex algorithm as applied to the
simplex tableau. The algorithmic steps follow directly from the preceding algebraic analysis
and the specific form of the foregoing tableau provided.
2. Determine the entering variable. Select as the entering variable, the nonbasic variable
with negative zj − cj . Denoted by xk . The column associated with xk is called the
pivot column. Go to Step 3.
3. Determine the departing variable. Use the minimum ratio test to determine the depart-
ing basic variable. That is, let
βr βi
= min | yi,k > 0
yr,k yi,k
Row r is called the pivot row, yr,k is called the pivot element, and the basic variable
xB,r , associated with row r is the departing variable. Go to Step 4.
k j k j
r ∗
yr,k yr,j becomes r 1 yr,j /yr,k
i yi,k yi,j i 0 yi,j − yi,k yr,j /yr,k
(c) Return to Step 1.
x1 x2 x3 x4 x5 x6 b Ratio
x4 2 1∗ 1 1 0 0 2 2
1 = 2∗
5
x5 1 2 3 0 1 0 5 2 = 2.5
6
x6 2 2 1 0 0 1 6 2 =3
z −3 −1 −3 0 0 0 0
We choose x2 as the entering variable to illustrate that any nonbasic variable with neg-
ative coefficient can be chosen as entering variable. The smallest ratio is given by x4 row.
Thus x4 is the leaving variable.
Tableau 2:
x1 x2 x3 x4 x5 x6 b Ratio
2
x2 2 1 1 1 0 0 2 1 =2
x5 −3 0 1∗ −2 1 0 1 1
1 = 1∗
x6 −2 0 −1 −2 0 1 2 −
z −1 0 −2 1 0 0 2
Tableau 3:
x1 x2 x3 x4 x5 x6 b Ratio
x2 5∗ 1 0 3 −1 0 1 1
5
x3 −3 0 1 −2 1 0 1 −
x6 −5 0 0 −4 1 1 3 −
z −7 0 0 −3 2 0 4
Tableau 4:
x1 x2 x3 x4 x5 x6 b
1 3
x1 1 5 0 5 − 15 0 1
5
3
x3 0 5 1 − 15 2
5 0 8
5
x6 0 1 0 −1 0 1 4
7 6 3 27
z 0 5 0 5 5 0 5
We note that the extreme point sequence that the simplex method passes through are
{x4 , x5 , x6 } → {x2 , x5 , x6 } → {x2 , x3 , x6 } → {x1 , x3 , x6 }.
Max z = x1 + 2x2
subject to x1 + 38 x2 + x3 = 4
x1 + x2 + x4 = 2
2x1 + x5 = 3
x1 , x2 , x3 , x4 , x5 ≥ 0
4 6 7 16
(Ans: x∗ = ( , , 0, 0, )T with z ∗ = )
5 5 5 5