How to check in an easy way that the optimal... optimal. really ()

How to check in an easy way that the optimal solution you have found is
really optimal.
()
June 21, 2006
1 / 28
Duality
max z
= 2x1
x1
2x1
x1
x1 ,
−3x2
−x2
+x2
−x2
x2 ,
+4x3
+2x3
+3x3
+x3
x3
≤
≤
≤
≥
7
22
2
0
Let z ∗ be the optimal value of this LP. Easy to find lower bound.
()
June 21, 2006
2 / 28
Duality
max z
= 2x1
x1
2x1
x1
x1 ,
−3x2
−x2
+x2
−x2
x2 ,
+4x3
+2x3
+3x3
+x3
x3
≤
≤
≤
≥
7
22
2
0
Let z ∗ be the optimal value of this LP. Easy to find lower bound. Any
feasible solution gives a lower bound. Example x1 = 0, x2 = 3, x3 = 5
gives z = 11. This is a lower bound for z ∗ .
()
June 21, 2006
2 / 28
Upper bounds
We can also find upper bound for this LP.
First we add slack variables.
max z
= 2x1
x1
2x1
x1
x1 ,
−3x2
−x2
+x2
−x2
x2 ,
+4x3
+2x3 +s1
3x3
+s2
x3 ,
s1 ,
s2 ,
+s3
s3
=
=
=
≥
7
22
2
0
An upper bound can now be found.
2x1 − 3x2 + 4x3 ≤ 2x1 − 2x2 + 4x3 + 2s1
= 2(x1 − x2 + 2x3 + s1 ) = 14
So z ∗ ≤ 14.
()
June 21, 2006
3 / 28
In the same manner
2x1 − 3x2 + 4x3 ≤ 3x1 − 3x2 + 4x3 + s1 + 2s3
= (x1 − x2 + 2x3 + s1 ) + 2(x1 − x2 + x3 + s3 )
= 7 + 2 · 2 = 11
So 11 ≤ z ∗ ≤ 11. We have found that the optimal value for the LP is 11.
()
June 21, 2006
4 / 28
More general
Take linear combinations of the functional equalities. If this is larger than
the objective function, then we obtain an upper bound.
y1 (x1 − x2 + 2x3 + s1 )+
y2 (2x1 + x2 + 3x3 + s2 )+
y3 (x1 − x2 + x3 + s3 ) = 7y1 + 22y2 + 2y3
Rearranging terms:
(y1 + 2y2 + y3 )x1 + (−y1 + y2 − y3 )x2
+(2y1 + 3y2 + y3 )x3 + y1 s1 + y2 s2 + y3 s3 = 7y1 + 22y2 + 2y3
()
June 21, 2006
5 / 28
Choose y1 , y2 , y3 such that
y1
−y1
2y1
y1 ,
+2y2
+y2
+3y2
y2 ,
+y3
−y3
+y3
y3
≥
≥
≥
≥
2
−3
4
0
Then 7y1 + 22y2 + 2y3 is an upper bound.
()
June 21, 2006
6 / 28
Smallest as possible upper bound
We try to obtain an upper bound as small as possible.
min w
s.t.
= 7y1
y1
−y1
2y1
y1 ,
+22y2
+2y2
+y2
+3y2
y2 ,
+2y3
+y3
−y3
+y3
y3
≥
≥
≥
≥
2
−3
4
0
Let w ∗ be the optimal value for this LP. Then
z∗ ≤ w∗
()
June 21, 2006
7 / 28
The LP
Pn
c j xj
max
Pj=1
n
s.t.
j=1 aij xj
xj
≤ bi , i = 1, . . . , m
≥ 0,
P
min Pm
i=1 bi yi
m
s.t.
i=1 aij yi
yi
≥ cj , j = 1, . . . , n
≥ 0
has as dual LP
To distinguish the dual from the original LP, we call the original one the
primal LP.
()
June 21, 2006
8 / 28
Primal
coefficients objective function
RHS constants
constraint i
variable xj
constraint i:
variable xj
()
Primal
max z
≤
=
≥
≥0
unconstrained
≤0
Dual
RHS constants
coefficients objective function
variable yi
constraint j
Dual
min w
variable yi :
constraint j:
≥0
unconstrained
≤0
≥
=
≤
June 21, 2006
9 / 28
constraint i:
variable xj
()
Dual
max z
≤
=
≥
≥0
unconstrained
≤0
Primal
min w
variable yi :
constraint j:
≥0
unconstrained
≤0
≥
=
≤
June 21, 2006
10 / 28
If you do not remember this table anymore, it is easy to construct it.
max z
= −5x1
x1
2x1
x1 ,
−6x2
+x2 ≤ 3
−4x2 ≤ 5
x2
≤ 0
Substitution x10 = −x1 and x20 = −x2 .
max z
()
= 5x10
−x10
−2x10
x10 ,
+6x20
−x20
≤ 3
+4x20 ≤ 5
x20
≥ 0
June 21, 2006
11 / 28
()
min w
= 3y1
−y1
−y1
y1 ,
min w
= 3y1
y1
y1
y1 ,
+5y2
−y2 ≥ 5
+4y2 ≥ 6
y2
≥ 0
+5y2
+2y2 ≤ −5
−4y2 ≤ −6
y2
≥ 0
June 21, 2006
12 / 28
The dual of the dual LP is the primal.
()
June 21, 2006
13 / 28
Weak duality
Let c1 x1 + · · · + cn xn be the objective function of the primal LP and
b1 y1 + · · · + bm ym be the objective function of the dual LP.
Weak duality
For each solution x 0 = (x10 , . . . , xn0 ) of the primal LP and each solution
0 ) of the dual LP,
y 0 = (y10 , . . . , ym
0
c1 x10 + · · · + cn xn0 ≤ b1 y10 + · · · + bm ym
If the primal is unbounded, then the dual is infeasible (has no solution). If
the dual is unbounded, then the primal is infeasible.
()
June 21, 2006
14 / 28
max z
s.t.
= x1
+x2
−x1 +2x2 ≤ 1
≤ 1
x2
x1 , x2
≥ 0
This LP is unbounded. The dual LP is:
min w
= y1
+y2
−y1
≥ 1
2y1 +y2 ≥ 1
y1 , y2
≥ 0
This LP must be infeasible. (Also without duality this is easy to see.)
()
June 21, 2006
15 / 28
strong duality
If both the primal and its dual are feasible (have feasible solutions), then
they have optimal solutions.
Let
x ∗ = (x1∗ , . . . , xn∗ )
be an optimal solution for the primal LP, and
∗
y ∗ = (y1∗ , . . . , ym
)
be an optimal solution of the dual LP.
Strong Duality
∗
c1 x1∗ + · · · + cn xn∗ = b1 y1∗ + · · · + bm ym
.
()
June 21, 2006
16 / 28
An optimal solution for the dual LP can be read from an optimal simplex
tableau of the primal LP.
max z
= 120x1 +80x2
x1
x2
20x1 +10x2
x1 ,
x2
≤
≤
≤
≥
40
10
500
0
Augmented form is:
max z
s.t.
()
z
−120x1 −80x2
+s1
x1
x2
+s2
20x1
+10x2
+s3
x1 ,
x2 ,
s1 , s2 , s3
=
=
=
=
≥
0
40
10
500
0
June 21, 2006
17 / 28
Initial simplex tableau:
z
s1
s2
s3
z
1
0
0
0
x1
−120
1
0
20
x2
−80
0
1
10
s1
0
1
0
0
s1
0
1
0
0
s2
20
s2
0
0
1
0
s3
0
0
0
1
0
40
10
500
Optimal simplex tableau is:
z
s1
x2
x1
()
z
1
0
0
0
x1
0
0
0
1
x2
0
0
1
0
1
2
1
− 12
s3
6
1
− 20
0
1
20
b
3200
20
10
20
June 21, 2006
18 / 28
The dual LP is:
min w
= 40y1 +10y2
y1
y2
y1 ,
y2 ,
+500y3
+20y3 ≥ 120
+10y3 ≥ 80
y3
≥ 0
We can read an optimal solution for the dual LP in the row of z under the
slack variables. It is y1 = 0, y2 = 20, y3 = 6.
()
June 21, 2006
19 / 28
The dual LP is:
min w
= 40y1 +10y2
y1
y2
y1 ,
y2 ,
+500y3
+20y3 ≥ 120
+10y3 ≥ 80
y3
≥ 0
We can read an optimal solution for the dual LP in the row of z under the
slack variables. It is y1 = 0, y2 = 20, y3 = 6. Why is this?
()
June 21, 2006
19 / 28
On the simplex tableaux we only perform row operations. So
row z optimal simplex tableau = row z initial simplex tableau
+20 ∗ row s2 initial simplex tableau
+6 ∗ row s3 initial simplex tableau
+0 ∗ row s1 initial simplex tableau
The optimal simplex tableau has no negative entries in the row of z. So, if
y1 = 0, y2 = 20, y3 = 6
then
−120 +y1
+20y3 ≥ 0
−80
+y2 +10y3 ≥ 0
y1 , y2 , y3
≥ 0
So y1 = 0, y2 = 20, y3 = 6 is a feasible solution for the dual LP.
()
June 21, 2006
20 / 28
Furthermore,
0 + 40y1 + 10y2 + 500y3 = 3200
Hence y1 = 0, y2 = 20, y3 = 6 is an optimal solution.
()
June 21, 2006
21 / 28
Optimal solution dual LP
An optimal solution for the dual LP can be found in the simplex tableau as
the entries in the row of z under the slack variables.
()
June 21, 2006
22 / 28
We also see that
s1 y1 = 20 ∗ 0 = 0
s2 y2 = 0 ∗ 20 = 0
s 3 y3 = 0 ∗ 6 = 0
This is called complementary slackness.
()
June 21, 2006
23 / 28
Complementary slackness
If x ∗ = (x1∗ , . . . , xn∗ ) is an optimal solution of the primal and
∗ ) is an optimal solution of the dual, then
y ∗ = (y1∗ , . . . , ym
P
if nj=1 aij xj∗ < bi , then yi∗ = 0
P
if yi∗ > 0, then nj=1 aij xj∗ = bi .
In shorter form:
yi∗ (bi
−
n
X
aij xj∗ ) = 0 for i = 1, . . . , m.
j=1
Its dual is:
m
X
xj∗ (
aij yi∗ − cj ) = 0 for j = 1, . . . , n.
i=1
Why does this hold?
()
June 21, 2006
24 / 28
max z
s.t.
= 120x1 +80x2
x1
+s1
+s2
x2
20x1 +10x2
+s3
x1 ,
x2 ,
s1 , s2 , s3
=
=
=
≥
40
10
500
0
If x10 , x20 , x30 is a feasible solution of the primal and y10 , y20 , y30 is a feasible
solution for the dual LP, then
40y10 + 10y20 + 500y30 = y10 (x10 + s10 ) + y20 (x20 + s20 ) + y30 (20x10 + 10x20 + s30 )
= (y10 + 20y30 )x10 + (y20 + 10y30 )x20
+y10 s10 + y20 s20 + y30 s30
≥ 120x10 + 80x20 + y10 s10 + y20 s20 + y30 s30
If x10 , x20 , x30 and y10 , y20 , y30 are optimal solutions, then Strong Duality shows
that y10 s10 + y20 s20 + y30 s30 = 0.
()
June 21, 2006
25 / 28
Economic interpretation of the dual variables
max z
= 120x1 +80x2
x1
x2
20x1 +10x2
x1 ,
x2
≤
≤
≤
≥
40
10
500
0
Optimal simplex tableau is:
z
s1
x2
x1
z
1
0
0
0
x1
0
0
0
1
x2
0
0
1
0
s1
0
1
0
0
s2
20
1
2
1
− 12
s3
6
1
− 20
0
1
20
b
3200
20
10
20
So y1 = 0, y2 = 20, y3 = 6 is an optimal solution for the dual of the LP.
()
June 21, 2006
26 / 28
What happens if we increase in
x1 ≤ 40
the RHS a little bit?
Remember optimal value of the LP is (because of strong duality)
40y1 + 10y2 + 500y3
We do not increase the optimal value.
What if we increase in
x2 ≤ 10
the RHS a little bit? We increase the optimal value.
()
June 21, 2006
27 / 28
Some sensitivity
Definition
The variables y1 , y2 , y3 are called the shadow prices.
If we increase the amount of resource i by ∆, we earn yi ∆ more money.
(Only valid if we increase the amount a little bit.)
()
June 21, 2006
28 / 28