Lecture 4: The Simplex Method

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

MMAT5230 Mathematics for Logistics Spring 2023

Lecture 4: The Simplex Method


Lecturer: Lily PAN

4.1 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.

Consider the standard linear programming problem

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]

Based on this partitioning, the linear system Ax = b can be written to yield

BxB + NxN = b

Solving for xB yields


xB = B−1 b − B−1 NxN

Now setting xN = 0, the solution

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

Therefore, the current extreme-point solution can be represented in canonical form:


z = cTB B−1 b − (cTB B−1 N − cTN )xN
xB = B−1 b − B−1 NxN
with the current basic feasible solution given as

z = cTB B−1 b (4.1)


   −1 
xB B b
x= = ≥0 (4.2)
xN 0

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

z + (cTB B−1 N − cTN )xN = cTB B−1 b (4.3)


−1 −1
xB + B NxN = B b (4.4)

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

Or, written more compactly:

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

The tableau can also be written in terms of its component elements.

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.

Checking for Optimality

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.

Optimality conditions (Max problem)

B−1 b
   
xB
The basic feasible solution x = = will be optimal if
xN 0

−(zj − cj ) = −(cTB B−1 aj − cj ) ≤ 0, for all j ∈ J

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.

Determining the Entering Variable

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.

Determining the Departing Variable

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

First, multiplying both sides of (4.8) by B yileds


 
y1,k
m
 y2,k  X
 
ak = Byk = b1 , b2 , . . . , bm  .  = yj,k bj (4.9)
 .. 
j=1
ym,k

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

xB = B−1 b + xk (−B−1 ak ) = B−1 b − xk yk

Now let


β1
 β2 
B−1 b = β =  . 
 
 .. 
βm

Then, because all variables must remain nonnegative, it follows that

   
β1 y1,k
 β2   y2,k 
− x k . ≥0
   
 .. 
 .   .. 
βm ym,k

and an upper bound on xk can be found as

 
β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.

The Simplex Algorithm (Maximization problem)

1. Check for possible improvement. Examine the zj − cj in row 0.



 If all zj − cj ≥ 0, then the current BFS is optimal; stop.
 If any zj − cj < 0, go to Step 2.

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.

4. Pivot and establish a new tableau.

(a) The entering variable xk is the new basic variable in row r.


(b) 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 .
Lecture 4: The Simplex Method 4-7

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.

Example 4.1.1. Consider the LP problem:

Max z = 3x1 + x2 + 3x3


Subject to 2x1 + x2 + x3 ≤ 2
x1 + 2x2 + 3x3 ≤ 5
2x1 + 2x2 + x3 ≤ 6
x1 , x2 , x3 ≥ 0

By adding slack variables x4 , x5 and x6 , we have the following initial tableau.


Tableau 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

Initial tableau, current BFS is x = [0, 0, 0, 2, 5, 6]T and z = 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

Current BFS is x = [0, 2, 0, 0, 1, 2]T and z = 2.


Lecture 4: The Simplex Method 4-8

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

Current BFS is x = [0, 1, 1, 0, 0, 3]T and z = 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

Optimal tableau, optimal BFS is x = [1/5, 0, 8/5, 0, 0, 4]T and z ∗ = 27/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 }.

Exercise 4.1.1. Solve the following LP by Simplex method.

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy