Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
9/19/2012
x 2 3 x3
x1 4 x 2
s/t
U.B.
3 x1
optimal
x 2 x3
x 2 , x3 0
x1 ,
max
L.B.
a feasible solution
0, 0, 0
z 0,
z 0 4 x1 x 2 3 x 3
1, 0, 0
z 4,
z 4 4 x1 x 2 3 x 3
0, 0, 3
z 9,
z 9 4 x1 x 2 3 x 3
4 x2
3 x1
x2
x3
y1 3 y 2 x1 4 y1 y 2 x 2
4
y1 0
y2 0
y 2 x 3 y1 3 y 3 Fact 1
3 0
Since x i 0
Fact 2:
y1 3 y 2
4 y1 y 2
y2
z 4 x1 x 2 3 x 3 y1 3 y 2 x1 4 y1 y 2 x 2 y 2 x 3
y1 3 y 3
Rev. 9/19/2012
4 y1 y 2 1
y2 3
y2 0
y1 ,
Any feasible solution of this dual will provide an upper bound to the LP.
2, 3
z 11,
z 4 x1 x 2 3 x 3 11 z
1, 3
z 10,
z 4 x1 x 2 3 x 3 10 z
Rev. 9/19/2012
m ax
c1 x1 c 2 x 2
s/t
a11 x1 a12 x 2
a1 n x n b1
y1
a 21 x1 a 22 x 2
a 2 n x n b2
y2
a m 1 x1 a m 2 x 2
x1 ,
cn xn
a m n x n bm
x2 ,
xn
ym
(Dual)
m in
b1 y1 b 2 y 2
s/t
a11 y1 a 21 y 2
a m 1 y m c1
a12 y1 a 22 y 2
a m1 y m c2
a1 n y1 a 2 n y 2
a mn ym cm
y1 ,
y2 ,
bn y n
ym
Example:
(P)
m ax
z 5 x1 12 x 2 4 x 3
s/t
x1 2 x 2 x 3 10
2 x1 x 2 3 x 3 8
x1 , x 2 , x 3 0
x1 , x 2 , x 3 , w1 0
(D)
m in
10 y1 8 y 2
s/t
y1 2 y 2 5
2 y1 y 2 12
y1 3 y 2 4
y1
0 y 2 free
Rev. 9/19/2012
Example
m ax
z 5 x1 6 x 2
s/t
x1 2 x 2 5
x1 x1 x1
Substitute
x1 , x1 0
x1 5 x 2 3
4 x1 7 x 2 8
Normal
x1 free , x 2 0
z 5 x1 5 x1 6 x 2
s/t
x1 x1 2 x 2
4 x 4 x 7 x2
x1 x1 5 x 2 w1
x1 x1 x1
m ax
w2
x1 , x1 , x 2 , w1 , w 2 0
(Dual)
m in
s/t
5 y1 3 y 2 8 y 3
y1 y 2 4 y 3 5
y1 y 2 4 y 3 5
2 y1 5 y 2 7 y 3 6
y2
0
y 3 0
y1 y 2 4 y 3 5
y 2 0, y 3 0
y1 free
Max LP
Equations
Variables
Min LP
0
0
free
0
0
free
Variables
Equations
Rev. 9/19/2012
min
problem
dual gap
max
problem
Consider an LP:
<P> max c ' x
Ax b
s/t
max
s/t
c1 x1 c 2 x 2
cn xn
a11 x1
a1 n x n b1
a m 1 x1
a m n x n bm
x0
<D>
min
s/t
x1 ,
, xn 0
b'y
A' y c
y0
Theorem 5.1
Let
x x1 , x 2
y y1 , y 2
A y
Rev. 9/19/2012
Then c T x * b T y *
Proof:
Suppose we apply the simplex method. Assume that an optimal solution exits. The proof
is enough to show that a dual feasible solution y * satisfies c ' x * b ' y *
x 1 x n x n 1 x m
1
Z Z
C 1* C n* d 1* d
in optimal tableau
*
n
BU
= c j x *j
j B
= cjx
cjxj
*
j N
x n 1
i 1
*
j
j B
Let
cj
di
Then
Z Z
*
cjxj
*
j 1
wi
i 1
y i d i , i 1, 2,
Let
*
i
,m
Z
*
cjxj
j 1
cjxj
*
j 1
*
j
xj
by
i
i 1
1. Z *
by
i
i 1
*
i
*
i
y b a
i 1
xni
c
j 1
*
i
i 1
c
j 1
*
j
i 1
ij
j 1
xi
*
y i a ij x j
*
i
xj
c'x b'y
*
Optimality
i 1
Rev. 9/19/2012
2. c j c *j y i* a ij
i 1
m
c j c j y i a ij 0
*
By definition
i 1
y i a ij c j
*
i 1
3. y i* d i* 0
yi 0
*
Primal-dual Relationships
Based on the weak duality theorem and the strong duality theorem, following four cases
are possible:
Example:
Max 2 x1 x 2
s/t
x1 x 2 1
1
2
3
4
Primal
Optimal
Infeasible
Unbounded
Infeasible
Min
s/t
Dual
Optimal
Unbounded
Infeasible
Infeasible*
y1 2 y 2
y1 y 2 2
x1 x 2 2
y1 y 2 1
x1 , x 2 0
y1 , y 2 0
Rev. 9/19/2012
y y1 , y 2 ,
x n 1 ,
y n 1 ,
, y n is dual feasible.
Then x and y are optimal for their respective problems if and only if (iff for short)
x j ym j x j c j
ij
i 1
y i 0, j 1, 2,
y i x n i y i a ij x j bi 0, i 1, 2,
j 1
,n
,m
Proof:
i.
From the weak duality
c'x A' y'x
xj
ij
yi x j
or
ij
yi
xj cj
a
i
ij
,n
yi 0
x j y m j 0, j 1, 2,
ii.
a
i
ij
x j yi
by
i
bi
a
j
ij
xj
y i a ij x j bi bi 0
j 1
y i x n i 0, i 1, 2,
Rev. 9/19/2012
For example
<P> max
s/t
5 x1 4 x 2
<D>
24 y1 6 y 2 y 3 2 y 4
min
s/t
6 x1 4 x 2 24
6 y1 y 2 y 3 5
x1 2 x 2 6
4 y1 2 y 2 y 3 y 4 4
x1 x 2 1
y1 , y 2 , y 3 , y 4
x2 2
x1 , x 2 0
y1
3
4
, y2
1
2
, y 3 y 4 0, 2 1
Rev. 9/19/2012
(P)
m ax
4 x1
x1 4 x 2
s/t
x1 ,
x4
1 -
x5
4 y1 -
y1 ,
y2
4
1
y2
y2
(maximization problem)
4 x1 x 2
3 x3
x1 - 4 x 2
not optim al
feasible
3 - 3 x1 x 2 -
Dual Dictionary
x3
(minimization problem)
m in y1
3 y2
y3
-4
y1 3 y 2
y4
- 1 4 y1 -
y5
-3
- m ax ( - ) - y1 3 y 2
y2
* N o entering v ariable
* N ot feasible
y2
1 x1 x 2 x 3
P =
y1 3 y 2
y1 3 y 2
x3 0
x2 ,
Primal Dictionary
m in
s/t
x 2 x3
3 x1 -
(D )
x 2 3 x3
0 4 1 3
1 -1 -4 0
3 -3 1 -1
z
x 4 y1
D = -P =
x5 y 2
y1
1
1
4
0
y2
y3
y4
y5
10
Rev. 9/19/2012
Another Example:
(P ) m ax
- x1 -
s/t
- 2 x1 -
x2
Q:
x2
- 2 x1 4 x 2 - 8
(D ) m in
4 y1 - 8 y 2 - 7 y 3
s/t
- 2 y1 - 2 y 2 - y 3
-1
- y1 4 y 2 3 y 3
-1
- x1 3 x 2 - 7
x2
x1 ,
y1 ,
y2 ,
y3
min = -max -
Write dictionaries
(P )
- x1 -
x2
x3
4 2 x1 x 2
x4
- 8 2 x1 - 4 x 2
x5
-7
(D )
x1 - 3 x 2
y4
1 - 2 y1 - 2 y 2 -
y5
1 -
- 4 y1 8 y 2 7 y 3
y3
y1 4 y 2 3 y 3
(P rim al S im plex)
(D ual S im plex)
ex )
i non-basic variables |
x1,
ratio
ci
a ki
, a ki < 0, c i
1
2
11
Rev. 9/19/2012
-4 -
x4
2
x3
x1
x5
12
4
x4 5 x2
1
2
-3
- 3 x2
x4
1
2
2 x2
x4 -
y3
y2
y5
y1 -
2
3
5 y1 -
y4
1
2
2 y4
y3
y3
y5
-7 -
x3
18
2 x5 7 x 2
x1
x5 3 x 2
x4
2 x5 +
x4
7 - 18 y1 - 7 y 4 - 6 y 2
y1
y3
1 -
2 y1 -
y4
y5
4 -
7 y1 - 3 y 4
y4
- 2 y 2 x5 0
- 2 y2 x2 0
y2
2 x2
x 2 0,
x1
- 4 x2
optim al
feasible
x1 7,
3 y3
x2
x3
x5
4 y4
- 1 2 y1 -
both
z
-7
optim al
feasible
y 3 1, y 5 4
y1 y 2 y 4 0
- 7 - 7
z -7
12
Rev. 9/19/2012
m ax
s/t
4 x2
x2 4
- 2 x1 -
N ot optim al
&
N ot feasible
- 2 x1 4 x 2 - 8
- x1 3 x 2 - 7
x2 , 0
x1 ,
Phase I: Apply the dual simplex method to make the problem feasible.
- x1 4 x 2
x3
x4
-8
2 x1 - 4 x 2
x5
-7
x1 - 3 x 2
2 x1
x2
x1
enters
x4
leaves
x4
en ters
x5
lea ves
-4 -
x4 2 x2
2
x3
12
x4 5 x2
x1
x5
x3
18
x5
x1
x5 3 x 2
x4
6 2 x5
2
-3
x4 2 x2
1
2
-7
x4 -
x5
x2
2 x2
2 x2
2 x2
U nbounded over x 2
Finally, apply the primal simplex method to find the optimal solution. This is left for your
exercise problem.
13
Rev. 9/19/2012
Test Problems 1
P m in
s /t
x1
2 x 2 3 x3
3 x2
- x1
2 x1 -
x 2 3 x3 6
x3 4
x1 0,
D
s/t
m ax
x 2 0,
x 3 free
5 y1 6 y 2 4 y 3
- y1
3 y1 -
2 y2
y2
3 y2 y3
y1 free ,
y 2 0,
y3 0
14
Rev. 9/19/2012
Test Problem 2:
3 x1 2 x 2 5 x 3
<P > m ax
x1 2 x 2
s/t
3 x1
x3
430
2 x3
460
x1 4 x 2
x1 ,
<D >
m in
s /t
x2 ,
420
x3 0
3 y2
y3 3
4 y3 2
2 y1
y1
y1 ,
2 y2
y2 ,
y3
y 2 = 2, y 3 = 0
15