Simplex 3
Simplex 3
programming
Outline
Fundamental theorem
Simplex algorithm
Examples and standard form Fundamental theorem Simplex algorithm
b2
a2
am
bn−1
Origin
bn
Destination
Examples and standard form Fundamental theorem Simplex algorithm
I Formulation:
m X
X n
min s = cij xij
i=1 j=1
xij ≥ 0, i = 1, . . . , m; j = 1, . . . , n.
where ai is the supply of the i-th origin, bj is the demand of the j-th
destinations, xij is the amount of the shipment from source i to
destination j and cij is the unit transportation cost from i to j.
I Optimization problem (Simplex method)
Examples and standard form Fundamental theorem Simplex algorithm
Linear programming
I Definition:
If the minimized (or maximized) function and the constraints are all in
linear form
a1 x1 + a2 x2 + · · · + an xn + b.
where c, x ∈ Rn .
I There are 3 kinds of constraints in general:
I Type I: “≤” type constraint
I Example 2: (type I)
max w = 7x + 12y
s.t. 9x + 4y ≤ 360
4x + 5y ≤ 200
3x + 10y ≤ 300
x ≥ 0, y ≥ 0
I Standard form
a11 x1 + a12 x2 + · · · + a1n xn = b1
..
.
am1 x1 + am2 x2 + · · · + amn xn = bm
xi ≥ 0, i = 1, . . . , n
where bi ≥ 0 (i = 1, . . . , m).
I In matrix form
min w = cT x (or max)
x
Constraints
s.t. Ax = b, x ≥ 0
xi ≥ 0, i = 1, 2, 3, 4
I Introduce surplus variable x5 ≥ 0, then the constraint becomes the
standard form
xi ≥ 0, i = 1, 2, 3, 4, 5
Examples and standard form Fundamental theorem Simplex algorithm
I Example 2:
max w = 7x + 12y
s.t. 9x + 4y ≤ 360
4x + 5y ≤ 200
3x + 10y ≤ 300
x ≥ 0, y ≥ 0
I
Introduce slack variable x1, x2, x3 ≥ 0 and let x4 = x, x5 = y, then the
constraint becomes the standard form
I Example 3:
min w = x1 + 3x2 + 4x3
s.t. x1 + 2x2 + x3 = 5
2x1 + 3x2 + x3 = 6
x2 ≥ 0, x3 ≥ 0
I Deal with the free variable x1 : Solving x1 from one equation and
substitute it into others.
x1 = 5 − 2x2 − x3
then
min w = 5 + x2 + 3x3
s.t. x2 + x3 = 4
x2 ≥ 0, x3 ≥ 0
Examples and standard form Fundamental theorem Simplex algorithm
Remark
Outline
Fundamental theorem
Simplex algorithm
Examples and standard form Fundamental theorem Simplex algorithm
Definitions
Ax = b.
Definitions
Example
I Linear programming
max w = 10x1 + 11x2
3x1 + 4x2 + x3 = 9
5x1 + 2x2 + x4 = 8
x1 − 2x2 + x5 = 1
xi ≥ 0, i = 1, 2, 3, 4, 5
I Choose B = (a3 , a4 , a5 ) = I 3×3 , then B is a basis,
x = (0, 0, 9, 8, 1)
Example
I Linear programming
max w = 10x1 + 11x2
3x1 + 4x2 ≤ 17
2x1 + 5x2 ≤ 16
xi ≥ 0, i = 1, 2
I The set of all the feasible solutions are called feasible region.
0000000000000000000
1111111111111111111
1111111111111111111
0000000000000000000
0000000000000000000
1111111111111111111
feasible region
0000000000000000000
1111111111111111111
0000000000000000000
1111111111111111111
0000000000000000000
1111111111111111111
0000000000000000000
1111111111111111111
0000000000000000000
1111111111111111111
0000000000000000000
1111111111111111111
0000000000000000000
1111111111111111111
0000000000000000000
1111111111111111111
0000000000000000000
1111111111111111111
0000000000000000000
1111111111111111111
0000000000000000000
1111111111111111111
0000000000000000000
1111111111111111111
0000000000000000000
1111111111111111111
0000000000000000000
1111111111111111111
0000000000000000000
1111111111111111111
0000000000000000000
1111111111111111111
0000000000000000000
1111111111111111111
0000000000000000000
1111111111111111111
0000000000000000000
1111111111111111111
Definitions
Fundamental theorem
Zmax
=C*X
11111111111111111111111111111111111111111
00000000000000000000000000000000000000000
00000000000000000000000000000000000000000
11111111111111111111111111111111111111111
Zmin 00000000000000000000000000000000000000000
11111111111111111111111111111111111111111
=C*X
00000000000000000000000000000000000000000
11111111111111111111111111111111111111111
00000000000000000000000000000000000000000
11111111111111111111111111111111111111111
00000000000000000000000000000000000000000
11111111111111111111111111111111111111111
00000000000000000000000000000000000000000
11111111111111111111111111111111111111111
00000000000000000000000000000000000000000
11111111111111111111111111111111111111111
00000000000000000000000000000000000000000
11111111111111111111111111111111111111111
00000000000000000000000000000000000000000
11111111111111111111111111111111111111111
00000000000000000000000000000000000000000
11111111111111111111111111111111111111111
00000000000000000000000000000000000000000
11111111111111111111111111111111111111111
00000000000000000000000000000000000000000
11111111111111111111111111111111111111111
00000000000000000000000000000000000000000
11111111111111111111111111111111111111111
00000000000000000000000000000000000000000
11111111111111111111111111111111111111111
00000000000000000000000000000000000000000
11111111111111111111111111111111111111111
00000000000000000000000000000000000000000
11111111111111111111111111111111111111111
00000000000000000000000000000000000000000
11111111111111111111111111111111111111111
00000000000000000000000000000000000000000
11111111111111111111111111111111111111111
Examples and standard form Fundamental theorem Simplex algorithm
I There are three cases for the feasible solutions of the standard form
I Empty set;
I Unbounded set;
111111111111111111
000000000000000000
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
unbounded convex
Outline
Fundamental theorem
Simplex algorithm
Examples and standard form Fundamental theorem Simplex algorithm
Simplex method
Canonical form
Ax = b, x ≥ 0
Transfer
Transfer
I We have
m
X
(xi − yik )ai + ak = b
i=1
is a feasible solution.
I To make it a basic solution we choose
nx o xr
i
= min yik > 0 =
1≤i≤m yik yrk
then x̃ is a basic feasible solution, and let ar leave the basis.
I If yik ≤ 0 for i = 1, 2, . . . , m, then for any > 0, x̃ is feasible, thus the
feasible region is unbounded in this case.
Examples and standard form Fundamental theorem Simplex algorithm
x = (4, 3, 1, 0, 0, 0)
x = (0, 1, 3, 2, 0, 0).
Examples and standard form Fundamental theorem Simplex algorithm
I The aim is to choose k such that the objective function decreasing after
ak enter the basis.
I Suppose the canonical form is
n
X
xi + yij xj = yi0 , i = 1, 2, . . . , m
j=m+1
Pm
where zj = cTB y j = k=1 ck ykj .
I If there exists j (m + 1 ≤ j ≤ n) such that rj = cj − zj < 0, then when
xj change from 0 to positive, the objective function will be decreased.
Examples and standard form Fundamental theorem Simplex algorithm
Simplex strategy
Example
I Example
min z = −(3x1 + x2 + 3x3 )
2 1 1 x1 2
x2 ≤ 5 , x ≥ 0
1 2 3
2 2 1 x3 6
I Step 1: change into standard form
Example
Basis a1 a2 a3 a4 a5 a6 b
a4 2 1 1 1 0 0 2
a5 1 2 3 0 1 0 5
a6 2 2 1 0 0 1 6
rj −3 −1 −3 0 0 0 z0 = 0
Examples and standard form Fundamental theorem Simplex algorithm
Example
Example
Basis a1 a2 a3 a4 a5 a6 b
a2 5 1 0 3 −1 0 1
a3 −3 0 1 −2 1 0 1
a6 −5 0 0 −3 2 1 4
rj −7 0 0 −3 2 0 z0 = −4
Examples and standard form Fundamental theorem Simplex algorithm
Example
Basis a1 a2 a3 a4 a5 a6 b
1 3
a1 1 5
0 5
− 15 0 1
5
3
a3 0 5
1 − 15 2
5
0 8
5
a6 0 1 0 −1 0 1 4
7 6 3
rj 0 5
0 5 5
0 z0 = − 27
5
Examples and standard form Fundamental theorem Simplex algorithm
Example
I An auxiliary problem (y ∈ Rm )
m
X
min z = yi
i=1
Ax + y = b
x ≥ 0, y ≥ 0
I The initial basic feasible solution is trivial
(x, y) = (0, b)
rk = min{rj | rj < 0}
I Bland’s method: Change the strategy of leaving and entering basis into
1. If more than one index j such that rj < 0, let
k = min{j | rj < 0}