Professional Documents
Culture Documents
Duality
Robert J. Vanderbei
February 26, 2002
Resource Allocation
Given a cache of raw materials and a factory for turning these raw materials into a variety of
finished products, how many of each product type should we make so as to maximize profit?
The resource allocation problem for m = 2 raw materials and n = 3 products:
maximize
subject to
c1 x1 +
c 2 x2 +
c3 x3
0,
where
cj
(1)
(2)
(3)
Closing Up Shop
j = 1, 2, 3.
b1 y1 +
b2 y2
a11 y1 + a21 y2 c1
a12 y1 + a22 y2 c2
a13 y1 + a23 y2 c3
y1 , y2
0 .
Duality
Every Problem:
maximize
subject to
n
X
cj xj
j=1
n
X
aij xj bi
i = 1, 2, . . . , m
xj 0
j = 1, 2, . . . , n,
j=1
Has a Dual:
minimize
subject to
m
X
i=1
m
X
bi yi
yi aij cj
j = 1, 2, . . . , n
i=1
yi 0
i = 1, 2, . . . , m.
Dual of Dual
Primal Problem:
maximize
subject to
n
X
j=1
n
X
cj xj
aij xj bi
i = 1, . . . , m
xj 0
j = 1, . . . , n,
j=1
m
X
i=1
m
X
bi yi
aij yi cj
j = 1, . . . , n
i=1
yi 0
i = 1, . . . , m.
If (x1 , x2 , . . . , xn ) is feasible for the primal and (y1 , y2 , . . . , ym ) is feasible for the dual,
then
X
X
c j xj
bi yi .
j
Proof.
(4)
(5)
(6)
(7)
If (x1 , x2 , . . . , xn ) is feasible for the primal and (y1 , y2 , . . . , ym ) is feasible for the dual,
then
X
X
c j xj
bi yi .
j
Proof.
(4)
X
yi aij xj
(5)
ij
(6)
(7)
If (x1 , x2 , . . . , xn ) is feasible for the primal and (y1 , y2 , . . . , ym ) is feasible for the dual,
then
X
X
c j xj
bi yi .
j
Proof.
(4)
X
yi aij xj
(5)
X X
=
aij xj yi
(6)
ij
(7)
If (x1 , x2 , . . . , xn ) is feasible for the primal and (y1 , y2 , . . . , ym ) is feasible for the dual,
then
X
X
c j xj
bi yi .
j
Proof.
(4)
X
yi aij xj
(5)
X X
=
aij xj yi
(6)
ij
X
i
bi yi .
(7)
If (x1 , x2 , . . . , xn ) is feasible for the primal and (y1 , y2 , . . . , ym ) is feasible for the dual,
then
X
X
c j xj
bi yi .
j
Proof.
X X
yi aij xj
(4)
yi aij xj
(5)
X X
=
aij xj yi
(6)
ij
X
i
bi yi .
(7)
If (x1 , x2 , . . . , xn ) is feasible for the primal and (y1 , y2 , . . . , ym ) is feasible for the dual,
then
X
X
c j xj
bi yi .
j
Proof.
X
cj xj
X X
yi aij xj
(4)
yi aij xj
(5)
X X
=
aij xj yi
(6)
ij
X
i
bi yi .
(7)
Gap or No Gap?
An important question:
Is there a gap between the largest primal value and the smallest dual value?
Primal Values
Dual Values
Gap
Primal Values
Dual Values
No Gap
A Primal Problem:
Its Dual:
Notes:
Dual is negative transpose of primal.
Primal is feasible, dual is not.
Second Iteration
Note: negative
transpose property
intact.
Again, use primal to pick pivot: x3 enters, w1 leaves.
Make analogous pivot in dual: z3 leaves, y1 enters.
Conclusion
Simplex method applied to primal problem (two phases, if necessary), solves both
the primal and the dual.
10
Conclusion on previous slide is the essence of the strong duality theorem which we now
state:
Theorem. If the primal problem has an optimal solution,
x = (x1 , x2 , . . . , xn ),
then the dual also has an optimal solution,
y = (y1 , y2 , . . . , ym
),
and
X
j
cj xj
bi yi .
Paraphrase:
If primal has an optimal solution, then there is no duality gap.
11
Duality Gap
Four possibilities:
Primal optimal, dual optimal (no gap).
Primal unbounded, dual infeasible (no gap).
Primal infeasible, dual unbounded (no gap).
Primal infeasible, dual infeasible (infinite gap).
2x1 x2
x1 x2
x1 + x2 2
x1 , x2
0.
12
Complementary Slackness
for j = 1, 2, . . . , n,
wi yi = 0,
for i = 1, 2, . . . , m.
xj z j
13
Proof
X
j
cj xj
(cj + zj )xj =
yi aij xj =
yi aij xj
ij
X X
X
X
=
aij xj yi =
(bi wi )yi
bi yi ,
i
(8)
(9)
for all j,
(10)
wi yi 0,
for all i.
(11)
xj zj
14
When: dual feasible, primal infeasible (i.e., pinks on the left, not on top).
An Example. Showing both primal and dual dictionaries:
15
16
17
18
19
An Example:
Notes:
Two objective functions: the true objective (on top), and a fake one (below it).
For Phase I, use the fake objectiveits dual feasible.
Two right-hand sides: the real one (on the left) and a fake (on the right).
Ignore the fake right-hand sidewell use it in another algorithm later.
Phase IFirst Pivot: w3 leaves, x1 enters.
After first pivot...
20
Recall current
dictionary:
After pivot:
21
Current dictionary:
Dual pivot:
w1 leaves,
w2 enters.
After pivot:
Its feasible!
22
Fourth PivotPhase II
Current dictionary:
Its feasible.
Ignore fake objective.
Use the real thing (top row).
Primal pivot: x3 enters, w4 leaves.
23
Final Dictionary
After pivot:
Problem is unbounded!