Simplex3
Simplex3
1
Pm
Recall c̄j = cj − i=1 xi,jcB(i) = cj − zj
2
Now write the original 0th row of the tableau as
0 = −z + c1x1 + · · · + cnxn.
Suppose j is a basis column with B(i) = j.
To make the jth entry in row 0 be 0 we need to mul-
tiply row i by −cB(i) = −cj and subtract from row
0.
Note too that the LHS of the equation will have value
m
X
−z0 = − xi,0cB(i)
i=1
which is exactly the cost of the current basic solution.
The same pivot rules should work for the 0th row .
That is, when column j enters the basis using pivot
xl,j we need to zero cj by using the same rules that
we used for the other rows Recall that, after pivoting,
x′l,j = 1. This means that, after all of the other piv-
oting operations, we need to multiply row l by c̄j and
subtract it from row 0.
4
We start with 0th row of tableau reflecting
n
X
−z0 = −z + c̄j xj
i=1
and this equation is maintained with every pivot. Recall that we
can only pivot on column j if c̄j < 0, and that if ∀j, c̄j ≥ 0, then
solution is optimal.
We can read the c̄j information off the top row of the tableau. So,
tableaus permit us to choose feasible pivot columns,and allow us
to implement pivots easily.. Assuming nondegeneracy of bases,
this gives us
procedure simplex
begin
opt:=‘no’, unbounded:=‘no’;
(comment: when either becomes ‘yes’, algorithm terminates)
while opt = ‘no’ and unbounded = ‘no’ do
if c̄j ≥ 0 for all j then opt:=‘yes’
else begin
choose any j such that c̄j < 0;
if xij ≤ 0 for all i then unbounded:= ‘yes’
else
find θ0 = min i
xi0
xij = xxk0
xij >0 kj
7
Column Selection
8
Q. For given column j how do we deal with ties in k?
That is, suppose more than one row k has xk,j > 0
and
!
xk0 xi0
= θ0 = min
xkj i xij
xij >0
9
A cycling example
Consider
x1 x2 x3 x4 x5 x6 x7
3 − 3/4 +20 −1/2 +6 0 0 0
0 1/ 4 −8 −1 9 1 0 0
0 1/2 −12 −1/2 3 0 1 0
1 0 0 1 0 0 0 1
10
x1 x2 x3 x4 x5 x6 x7
3 − 3/4 +20 −1/2 +6 0 0 0
0 1/ 4 −8 −1 9 1 0 0
0 1/2 −12 −1/2 3 0 1 0
1 0 0 1 0 0 0 1
x1 x2 x3 x4 x5 x6 x7
3 0 −4 −7/2 33 3 0 0
0 1 −32 −4 36 4 0 0
0 0 4 3/2 −15 −2 1 0
1 0 0 1 0 0 0 1
x1 x2 x3 x4 x5 x6 x7
3 0 0 −2 18 1 1 0
0 1 0 8 −84 −12 8 0
0 0 1 3/8 −15/4 −1/2 1/4 0
1 0 0 1 0 0 0 1
x1 x2 x3 x4 x5 x6 x7
3 1/4 0 0 −3 −2 3 0
0 1/8 0 1 −21/2 −3/2 1 0
0 − 3/64 1 0 3/16 1/16 −1/8 0
1 − 1/8 0 0 21/2 3/2 −1 1
11
x1 x2 x3 x4 x5 x6 x7
3 1/4 0 0 −3 −2 3 0
0 1/8 0 1 −21/2 −3/2 1 0
0 − 3/64 1 0 3/16 1/16 −1/8 0
1 − 1/8 0 0 21/2 3/2 −1 1
x1 x2 x3 x4 x5 x6 x7
3 − 1/2 16 0 0 −1 1 0
0 − 5/2 56 1 0 2 −6 0
0 − 1/4 16/3 0 1 1/3 −2/3 0
1 5/2 −56 0 0 −2 6 1
x1 x2 x3 x4 x5 x6 x7
3 − 7/4 44 1/2 0 0 −2 0
0 − 5/4 28 1/2 0 1 −3 0
0 − 1/6 −4 −1/6 1 0 1/3 0
1 0 0 1 0 0 0 1
x1 x2 x3 x4 x5 x6 x7
3 − 3/4 +20 −1/2 +6 0 0 0
0 1/4 −8 −1 9 1 0 0
0 1/2 −12 −1/2 3 0 1 0
1 0 0 1 0 0 0 1
12
We will now see Bland’s anticycling rule
that guarantees that cycles won’t occur.
Theorem:
Suppose in the simplex algorithm we choose the col-
umn to enter the basis by
j = min{j : cj − zj < 0}
(choose the lowest numbered favorable column), and
the row by
xi,0 xk,0
n o
B(i) = min B(i) : xi,j > 0 and ≤ for every k with xk,j > 0
xij xk,j
13
The “Real” Simplex Algorithm
A. If we begin with Ax ≤ b
then slack variables form a BFS.
Otherwise, we can use the artificial variable or two-
phase method. This works by adding m new artificial
variables xai, i = 1, . . . , m to the LP.
xa1 xam x1 xn
1 0
xj ≥ 0 j = 1, . . . , n
b A xai ≥ 0 i = 1, . . . , m
0 1
14
xa1 xam x1 xn
1 0
xj ≥ 0 j = 1, . . . , n
b A xai ≥ 0 i = 1, . . . , m
0 1
Pm a
Phase I. Minimize cost function ξ = i=1 xi
15
Case 3 (cont). ξ = 0 but some artificial variables
remain at zero level.
18
In order to implement the two-phase method, we can
have two row 0s; the first corresponding to the real
cost and the second corresponding to the artificial vari-
able cost. While pivoting during Phase I, we will main-
tain both of these rows.
20
The previous example was only implementing Phase
I.
21
Consider the following sequence of pivots in a LP
−34 −1 −14 −6 0 0 0 0
4 1 1 1 1 0 0 0
2 1 0 0 0 1 0 0
3 0 0 1 0 0 1 0
6 0 3 1 0 0 0 1
−32 0 −14 −6 0 1 0 0
2 0 1 1 1 −1 0 0
2 1 0 0 0 1 0 0
3 0 0 1 0 0 1 0
6 0 3 1 0 0 0 1
−20 0 −8 0 6 −5 0 0
2 0 1 1 1 −1 0 0
2 1 0 0 0 1 0 0
1 0 −1 0 −1 1 1 0
4 0 2 0 −1 1 0 1
−4 0 0 8 14 −13 0 0
2 0 1 1 1 −1 0 0
2 1 0 0 0 1 0 0
3 0 0 1 0 0 1 0
0 0 0 −2 −3 3 0 1
−4 0 0 −2/3 1 0 0 13/3
2 0 1 1/3 0 0 0 1/3
2 1 0 2/3 1 0 0 −1/3
3 0 0 1 0 0 1 0
0 0 0 −2/3 −1 1 0 1/3
−2 1 0 0 2 0 0 4
1 −1/2 1 0 −1/2 0 0 1/2
3 3/2 0 1 3/2 0 0 −1/2
0 −3/2 0 0 −3/2 0 1 1/2
2 1 0 0 0 1 0 0
22
They actually correspond to moving in the given order,
from vertex to vertex in the following polytope:
x3
1
2 x1
4 = 5
x2
23
In the previous example simplex we saw that simplex
moved along edges from vertex to vertex. We now
see that this always happens.
24
Theorem:
Let P be a polytope,
F = {x : Ax = b, x ≥ 0} the corresponding feasible
set, and
x̂ = (x1, . . . , xn−m), ŷ = (y1, . . . , yn−m)
be distinct vertices of P .