Lecture 4
Lecture 4
Lecture 4
Xavier Cabezas
FCNM-ESPOL
April 8, 2021
Outline
Simplex method
min { c0 x | Ax ≤ b } .
Also can be written as
min { c0 x | Ax = b, x ≥ 0 } ,
Theorem
Let L = min { c0 x | Ax = b, x ≥ 0 } be a linear programming problem
with a nonempty feasible region. c ∈ Rn , A ∈ Rm×n , rank(A) = m and
b ∈ Rm . Let x1 , . . . , xk be extreme points and d1 , . . . , dl be extreme
directions of the feasible region.
Proof.
Since the representation theorem, we have
X k l
X k
X
L = min c0 λ i xi + µj dj | λi = 1, λi ≥ 0, µj ≥ 0
i j i
.
1. ⇒) If c0 dj < 0 for some j and since µj ≥ 0 and L is a minimization
problem, then the L’s solution is unbounded. ⇐) Similar.
x2 x2
x1 x1
(a) A possible finite solution in a (b) A possible finite solution in a
bounded feasible region. unbounded feasible region.
Simplex method
Simplex method 8
Finding solution by exhaustive enumeration?
Simplex method 9
Checking optimality in extreme points
Simplex method 10
Checking optimality in extreme points
b̄ = B −1 b ≥ 0.
Ax = BxB + N xN = b, xB = B −1 b − B −1 N xN .
Simplex method 11
What if c0N − c0B B−1 N 0?
−1
• Consider x = x̄ + λdj = x̄ + λ −B aj .
ej
−1
• c0 x = c0 (x̄ + λdj ) = c0 x̄ + λc0 −B aj =
ej
c0 x̄ + λ(c0B (−B −1 aj ) + c0N ej ) = c0 x̄ + λ(cj − c0B B −1 aj ).
Simplex method 12
Checking unbounded solutions
Finding an extreme direction such that c0 dj < 0
• Let yj = B −1 aj ∈ Rm×1 .
−1
• Adj = B N −B aj = −aj + N ej = −aj + aj = 0.
ej
It is said that the basic variable xBr left the basis and the nonbasic xj
entered to the basis.
Simplex method 14
The Simplex algorithm for min { c0 x | Ax = b, x ≥ 0 }
Initialization: Find a starting extreme point x with basis B.
repeat
Compute c0N − c0B B −1 N ;
if c0N − c0B B −1 N ≥ 0 then
stop. x is an optimal extreme point;
else
Choose the most negative component c0j − c0B B −1 aj ;
if yj = B −1 aj ≤ 0 then
stop. The optimal objective value is unbounded;
else
b̄ = B −1 b;
n o
Compute r from min1≤i≤m yb̄iji | yij > 0 = yb̄rj
r
≥ 0;
−1 −1
B b −B aj
Update B and x = + yb̄rj
r
;
0 ej
end
end
until As long as necessary ;
Simplex method 15
The Simplex algorithm for min { c0 x | Ax = b, x ≥ 0 }
Initialization: Find a starting extreme point x with basis B.
repeat
Compute c0B B −1 N − c0N ;
if c0B B −1 N − c0N ≤ 0 then
stop. x is an optimal extreme point;
else
Choose the most positive component c0B B −1 aj − c0j ;
if yj = B −1 aj ≤ 0 then
stop. The optimal objective value is unbounded;
else
b̄ = B −1 b;
n o
Compute r from min1≤i≤m yb̄iji | yij > 0 = yb̄rjr
≥ 0;
−1 −1
B b −B aj
Update B and x = + yb̄rj
r
;
0 ej
end
end
until As long as necessary ;
Simplex method 16
The Simplex Tableau
With a starting basis we can write
Simplex method 17
The Simplex method examples
Simplex method 18
The Simplex method: A unbounded example
30 -30 40 70
25
80
20
x2
15
x1 - x2 ≤ 10
2 x1 ≤ 40
10 -
0 -50
0 5 10 15 20 25 30
x1
Simplex method 19
The Simplex method: An unbounded example
Initialization
1 0 1 −1 10
, c0B = 0 0 , c0N = −2
B= ,N= −1 , b = ,
0 1 2 0 40
x0 = 0 0 10 40 .
x1 x2 x3 x4
z 2 1 0 0 0
x3 1 -1 1 0 10
x4 2 0 0 1 40
Simplex method 20
The Simplex method: An unbounded example (Iter 1)
Optimal solution?
1 0 1 −1
c0B B −1 N − c0N = 0
0 − −2 −1 = 2 1 , j = 1,
0 1 2 0
x1 →
Objective function
value
unbounded?
−1 1 0 1 1
y1 = B a1 = = 0,
0 1 2 2
Ratio test
1 0 10 10
b̄ = B −1 b = = → min { 10/1, 40/2 } = 10, r = 3,
0 1 40 40
← x3
Updating
x and other
matrices
0 1 10
0 0 0
x=10 + 10 −1 = 0 .
40 −2 20
Simplex method 21
The Simplex method: An unbounded example (Iter 1)
Tableau form
x1 x2 x3 x4
z 2 1 0 0 0
x3 1 -1 1 0 10
x4 2 0 0 1 40
x1 x2 x3 x4
z 0 3 -2 0 -20
x1 1 -1 1 0 10
x4 0 2 -2 1 20
Simplex method 22
The Simplex method: An unbounded example (Iter 2)
Optimal solution?
1 0 −1 1
c0B B −1 N − c0N = −2
0 − −1 0 = 3 −2 ,
−2 1 0 0
j = 2, x2 →
Objective function
value
unbounded?
−1 1 0 −1 −1
y2 = B a2 = = 0,
−2 1 0 2
Ratio test
1 0 10 10
b̄ = B −1 b = = → min { −, 20/2 } = 10, r = 4,
−2 1 40 20
← x4
Updating
x and other
matrices
10 1 20
0 1 10
x= 0 + 10 0 = 0 .
20 −2 0
Simplex method 23
The Simplex method: An unbounded example (Iter 2)
Tableau form
x1 x2 x3 x4
z 0 3 -2 0 -20
x1 1 -1 1 0 10
x4 0 2 -2 1 20
x1 x2 x3 x4
z 0 0 1 -3/2 -50
x1 1 0 0 1/2 20
x2 0 1 -1 1/2 10
Simplex method 24
The Simplex method: An unbounded example (Iter 3)
Optimal solution?
0 1/2 1 0
c0B B −1 N − c0N = −2
−1 − 0 0 = 1 −3/2 ,
−1 1/2 0 1
j = 3, x3 →
Objective function
value
unbounded?
−1 0 1/2 1 0
y3 = B a3 = = ≤ 0,
−1 1/2 0 −1
Simplex method 25
The Simplex method: An unbounded example (Iter 3)
Tableau form
x1 x2 x3 x4
z 0 0 1 -3/2 -50
x1 1 0 0 1/2 20
x2 0 1 -1 1/2 10
x1 x2 x3 x4
z 2 1 0 0 0
x3 1 -1 1 0 100
x4 2 0 0 1 40
Simplex method 26
Other Issues in Simplex method
Simplex method 27