Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Adrian Vetta
1
1/39
This presentation is based upon the book Linear Programming by Vasek Chvatal
Part I
Weak Duality
2/39
3/39
cj
0
j [n]
i [m]
4/39
cj xj
m
X
i=1
bi yi
n
X
xj cj
j=1
n
X
j=1
m
X
i=1
m
X
i=1
5/39
xj
yi
m
X
i=1
n
X
j=1
yi bi
aij yi
aij xi
Part II
Strong Duality
6/39
7/39
cj xj =
m
X
i=1
bi yi
An Example
8/39
4x1
x1
5x1
x1
+ x2
x2
+ x2
+ 2x2
+ 5x3 +
x3 +
+ 3x3 +
+ 3x3
x1 , x2 , x3
3x4
3x4
8x4
5x4
, x4
1
55
3
0
y1
y1
y1
y1
3y1
+ 55y2 +
+ 5y2
+ y2
+
+ 3y2 +
+ 8y2
y1 , y2 ,
3y3
y3
2y3
3y3
5y3
y3
4
1
5
3
0
Optimal Solutions
maximise
subject to
4x1
x1
5x1
x1
+
+
x2
x2
x2
2x2
+
+
x1 ,
5x3
x3
3x3
3x3
x2 ,
+
+
+
x3
3x4
3x4
8x4
5x4
, x4
1
55
3
0
y1
y1
y1
y1
3y1
+
+
+
+
+
55y2
5y2
y2
3y2
8y2
y1 ,
+
+
y2 ,
3y3
y3
2y3
3y3
5y3
y3
4
1
5
3
0
The dual has optimal solution (y1 , y2 , y3 ) = (11, 0, 6) with value 29.
9/39
10/39
4x1
x1
5x1
x1
+ x2
x2
+ x2
+ 2x2
+ 5x3 +
x3 +
+ 3x3 +
+ 3x3
x1 , x2 , x3
3x4
3x4
8x4
5x4
, x4
1
55
3
0
=
4x1
= 1 x1
= 55 5x1
= 3 + x1
+ x2
+ x2
x2
2x2
+ 5x3
+ x3
3x3
3x3
3x4
3x4
8x4
5x4
Pivot 1
z
x5
x6
x7
=
=
=
=
1
55
3
4x1
x1
5x1
x1
+
+
x2
x2
x2
2x2
+
+
5x3
x3
3x3
3x3
3x4
3x4
8x4
5x4
=
=
=
=
1
55
3
z
x1
x6
x7
11/39
4(1 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2
x2
4x2
x2 ,
+
+
+
+
x3
3x3
x3
2x3
2x3
5
11
8
min
s.t.
5y1
2y1
3y1
y1
+
+
+
+
y1 ,
11y2
4y2
y2
2y2
y2 ,
+
+
+
+
y3
8y3
3y3
4y3
2y3
= 13 3x2
= 2 2x2
= 1 + x2
= 1 + 5x2
+
+
1x4 1x6
2x4 + x6
3x4 2x6
2x4
5
4
3
Example 3
17/39
5x1
x1
x1
2x1
2x1
+
+
5x2
3x2
x2
3x2
x1 ,
+
+
+
+
x2 ,
3x3
x3
3x3
2x3
x3
x3
min
s.t.
3
2
4
2
0
3y1
y1
3y1
y1
2y2
y2
3y2
y1 ,
+
+
+
y2 ,
4y3
2y3
y3
2y3
y3 ,
+
+
+
y4
2y4
2y4
3y4
y4
= 10
32
= 29
8
= 29
= 30
29
1
= 29
+
1x5
3
29 x7
8
29 x7
1
29 x7
28
29 x7
1x6 2x7
9
29
x6 +
5
+ 29 x6
3
29
x6
3
29 x6 +
5
29 x5
6
29 x5
8
29 x5
21
29 x5
32 8 30
So the primal solution is (x1 , x2 , x3 ) = ( 29
, 29 , 29 ) with value 10.
5
5
3
Part III
Proof of Strong Duality
18/39
19/39
cj xj =
m
X
i=1
bi yi
Intuition
Look at the initial dictionary:
z
x5
x6
x7
=
=
=
=
1
55
3
4x1
x1
5x1
x1
+
+
x2
x2
x2
2x2
+
+
5x3
x3
3x3
3x3
3x4
3x4
8x4
5x4
11x5
5x5
2x5
21x5
6x7
3x7
x7
11x7
=
=
=
=
29
14
5
1
x1
2x1
x1
5x1
2x3
4x3
x3
9x3
Intuition (cont.)
Lets verify this.
Add these constraints to the top row of the initial dictionary:
z
+
11 x5
+
6 x7
z + 11x5 + 6x7
4x1 +
x2
+ 5x3 +
= 11 (1
x1
x2
=
=
x1
x1
6
29
(3 +
Thus
z = 29 x1 2x3 11x5 6x7
21/39
x3
3x4
3x4 )
Intuition (cont.)
maximise
subject to
4x1
x1
5x1
x1
+
+
x2
x2
x2
2x2
+
+
x1 ,
5x3
x3
3x3
3x3
x2 ,
+
+
+
x3
3x4
3x4
8x4
5x4
, x4
1
55
3
0
22/39
Intuition: Example 2
Look at the initial dictionary:
z
x4
x5
x6
=
=
=
=
5
11
8
5x1
2x1
4x1
3x1
4x2
3x2
x2
4x2
3x3
x3
2x3
2x3
=
=
=
=
13
2
1
1
+
+
3x2
2x2
x2
5x2
+
+
1x4
2x4
3x4
2x4
1x6
x6
2x6
23/39
Intuition: Example 3
Look at the initial dictionary:
z
x4
x5
x6
x7
=
=
=
=
=
3
2
4
2
5x1
x1
x1
2x1
2x1
5x2
3x2
x2
3x2
3x3
x3
3x3
2x3
x3
=
=
=
=
=
10
32
29
8
29
30
29
1
29
1x5
3
x
29 7
8
x
29 7
1
x
29 7
28
x
29 7
1x6
9
x
29 6
5
x
29 6
3
x
29 6
3
x
29 6
2x7
+
5
x
29 5
6
x
29 5
8
x
29 5
21
x
29 5
Proof Idea
Does what we have seen always work? Run the simplex algorithm to find...
The values of the decision variables (x1 , x2 , . . . , xn ).
, x , . . . , x
The values of the slack variables (xn+1
n+m ).
n+2
n+m
X
k xk
k=1
[We know k 0 for all k, and for variables in the basis k = 0.]
25/39
aij yi cj
j [n]
i=1
26/39
cj xj =
m
X
i=1
bi yi
n
X
cj xj
j=1
n
X
cj xj
j=1
= z
n+m
X
k xk
k=1
n+m
X
k xk
k=1
= OPT(primal)
n+m
X
k=1
e.g. z = 10 x5 x6 2x7
27/39
k xk
28/39
n
X
cj xj
OPT
j=1
n+m
X
k xk
k=1
OPT
n
X
k=1
OPT
n
X
OPT
OPT
n
X
j xj
m
X
j xj
m
X
j=1
i=1
n
X
m
X
OPT
n+i xn+i
i=1
j xj
m
X
i=1
yi xn+i
yi
bi
n
X
i=1
j=1
k xk
k=n+1
j=1
n+m
X
k xk
!
bi yi
!
aij xj
j=1
n
m
X
X
j=1
i=1
!
aij yi
xj
cj xj =
OPT
j=1
m
X
!
bi yi
i=1
n
m
X
X
j=1
!
aij yi j
i=1
m
X
aij yi j
i=1
m
X
i=1
29/39
aij yi cj
xj
cj xj =
OPT
j=1
m
X
!
bi yi
i=1
n
m
X
X
j=1
!
aij yi
i=1
m
X
bi yi = 0
i=1
m
X
i=1
30/39
bi yi = OPT(primal) =
n
X
j=1
cj xj
xj
Part IV
Complementary Slackness
31/39
Weak Duality
32/39
n
X
xj cj
j=1
n
X
xj
m
X
j=1
i=1
m
X
n
X
i=1
m
X
i=1
yi
j=1
yi bi
aij yi
aij xj
Strong Duality
By strong duality, we must have equalities for the optimal solutions
}
{x1 , x2 , . . . , xn } and {y1 , y2 , . . . , ym
n
X
xj
cj
j=1
n
X
j=1
m
X
i=1
m
X
i=1
33/39
xj
yi
m
X
i=1
n
X
j=1
yi bi
aij yi
aij xj
Some Observations
Pn
j=1
xj cj
=
=
=
Pn
P
xj m
i=1 aij yi
Pj=1
m
Pn
yi j=1 aij xj
i=1
Pm
i=1 yi bi
m
X
aij yi
i=1
We also have
yi
n
X
aij xi = yi bi
j=1
34/39
Complementary Slackness
Complementary Slackness Theorem.
A primal feasible solution (x1 , x2 , . . . , xn ) and a dual feasible solution
) are both optimal if and only if
(y1 , y2 , . . . , ym
xj > 0
m
X
aij yi = cj
j [n]
aij xj = bi
i [m]
i=1
and
yi > 0
m
X
i=1
35/39
Part V
Consequences of Strong Duality
36/39
Running Times
It is easy to check that the dual of the dual is the primal.
So solving the dual will also give an optimal primal solution.
Recall the # pivots is typically linear in the number of constraints.
The # constraints in the dual is just the # variables, n, in the primal.
Thus O(n) pivots are typically needed to solve the dual.
So solving the dual can be far quicker than solving the primal!
37/39
Dual Variables
We have seen many examples where the dual problem often has a
nice combinatorial meaning.
In economic problems often the primal variables correspond to
allocations and the dual variables to prices.
38/39
Certificates
39/39