Title: Duality
1Duality
??????? ?????????
2Content
- The Dual of an LP in General Form
- Complementary Slackness
- The Shortest-Path Problem and Its Dual
- Dual Information in the Tableau
- The Dual Simplex Algorithm
3Duality
- The Dual of an LP in General Form
??????? ?????????
4An LP in General Form
5?Standard Form
6?Standard Form
7?Standard Form
8Optimality Criterion
Determined from the basis we choose.
9Optimality Criterion
? ?Rm
10RestrictedVariables
Inequalites
?
? ?Rm
11UnrestrictedVariables
? ?Rm
12UnrestrictedVariables
Equalites
?
? ?Rm
13Equalites
? ?Rm
14Equalites
?
UnrestrictedVariables
? ?Rm
15Inequalites
? ?Rm
16Inequalites
?
RestrictedVariables
? ?Rm
17Constraints(Primal)
?
Constraints(Dual)
? ?Rm
18Primal ? Dual
? ? ?
19Primal ? Dual
20Theorem 1
If an LP has an optimal solution, so does its
dual, at the optimality their costs are equal.
21Theorem 1
The constraint of the dual.
Has an optimum
Pf)
Let x and ? be feasible solutions to the primal
and the dual, respectively.
the cost ot primal
the profit of dual
?
Upper bounded
Lower bounded
optimal solution of primal
The profit upper-bound of the dual.
22Theorem 2
The duals dual is the primal.
23Theorem 2
The duals dual is the primal.
Pf)
Duals dual
24Theorem 2
The duals dual is the primal.
Pf)
Duals dual
25Example The Diet Problem
aij number of units of nutrient i in one unit
food j.
xj number of units of food j in the diet.
Minimize
Subject to
26Example The Diet Problem
aij number of units of nutrient i in one unit
food j.
xj number of units of food j in the diet.
Minimize
Subject to
Maximize
Subject to
27Example The Diet Problem
aij number of units of nutrient i in one unit
food j.
Minimize the total cost we need to pay so as to
get the required nutrients.
xj number of units of food j in the diet.
Minimize
Subject to
The amount of the jth food needed?
?
Maximize
Subject to
?
28Example The Diet Problem
aij number of units of nutrient i in one unit
food j.
Suppose that there is a pillmaker who can produce
all the nutrients needed.
xj number of units of food j in the diet.
Minimize
Subject to
Maximize the total price that a consumer needs to
pay so as to get the nutrients needed, i.e., to
maximize the profit.
Maximize
Subject to
The selling price for one unit of ith nutrient.
29Example The Diet Problem
aij number of units of nutrient i in one unit
food j.
One must get enough nutrients.
xj number of units of food j in the diet.
Minimize
Subject to
The unit price for each nutrient must be
reasonable, i.e., low enough.
Maximize
Subject to
30Example The Diet Problem
aij number of units of nutrient i in one unit
food j.
xj number of units of food j in the diet.
Minimize
Subject to
Maximize
Subject to
31Example The Diet Problem
aij number of units of nutrient i in one unit
food j.
xj number of units of food j in the diet.
Minimize
Subject to
Consumers View.
Maximize
Subject to
Producers View.
32Managing a Production Facility
33Managing a Production Facility
aij number of units of the ith raw material
needed to produce one unit of the jth
product.
xj the number of units of the jth product
produced.
34The Resource Allocation Problem
aij number of units of the ith raw material
needed to produce one unit of the jth
product.
xj the number of units of the jth product
produced.
Maximize
Subject to
35The Resource Allocation Problem
aij number of units of the ith raw material
needed to produce one unit of the jth
product.
xj the number of units of the jth product
produced.
36The Resource Allocation Problem
aij number of units of the ith raw material
needed to produce one unit of the jth
product.
xj the number of units of the jth product
produced.
37The Resource Allocation Problem
aij number of units of the ith raw material
needed to produce one unit of the jth
product.
xj the number of units of the jth product
produced.
Minimize
Subject to
Maximize
Subject to
38The Resource Allocation Problem
aij number of units of the ith raw material
needed to produce one unit of the jth
product.
xj the number of units of the jth product
produced.
39The Resource Allocation Problem
aij number of units of the ith raw material
needed to produce one unit of the jth
product.
Maximize the total profit.
xj the number of units of the jth product
produced.
The amount of the jth item produced?
?
?
40The Resource Allocation Problem
aij number of units of the ith raw material
needed to produce one unit of the jth
product.
xj the number of units of the jth product
produced.
Minimize the loss due to inventory, i.e., the
lost opportunity cost.
The estimated value increment for one unit of the
ith material
41The Resource Allocation Problem
aij number of units of the ith raw material
needed to produce one unit of the jth
product.
One can use up each material at most.
xj the number of units of the jth product
produced.
Dont underestimate the value increment for each
material.
42The Resource Allocation Problem
aij number of units of the ith raw material
needed to produce one unit of the jth
product.
xj the number of units of the jth product
produced.
43The Resource Allocation Problem
aij number of units of the ith raw material
needed to produce one unit of the jth
product.
xj the number of units of the jth product
produced.
Production Managers View
Comptrollers View
44Duality
??????? ?????????
45Complementary Slackness
46Theorem 3Complementary Slackness
x
?
Pf)
Facts
47Theorem 3Complementary Slackness
x
?
Pf)
Facts
u v 0
Define
x and ? are optima
u v 0
48Example
Does x(0, 0.5, 0, 2.5, 1.5) solve the LP?
49Example
Does x(0, 0.5, 0, 2.5, 1.5) solve the LP?
Primal
Dual
50Example
Does x(0, 0.5, 0, 2.5, 1.5) solve the LP?
Primal
Dual
?
?
?
0
0.5
0
2.5
1.5
x is an optimum
? (?2.5, 1, 1)
51Example
Does x(0, 0.5, 0, 2.5, 1.5) solve the LP?
Primal
Dual
?
Remember this result. It will be compared with
one obtaind using another method.
?
?
0
0.5
0
2.5
1.5
x is an optimum
? (?2.5, 1, 1)
52Duality
- The Shortest-Path Problem and Its Dual
??????? ?????????
53The Shortest-Path Problem
Given a directed graph G (V, E) and a
nonnegative weight cj ? 0 associated with each
arc ej?E, an instance of the shortest path
problem (SP) is the problem of finding a directed
path from a distinguished source node s to a
distinguished terminal node t, with the minimum
total weight.
54LP Formulation of SP
a
e1
e4
c4
c1
c3
t
s
e3
e2
e5
c5
c2
b
Flow vector
Incidence Matrix
Flow conservation for node i
Cost vector
55a
e1
e4
t
s
e3
e2
e5
b
56The Dual of SP
Primal
Dual
57The Dual of SP
Primal
Dual
58Explanation for the Primal/Dual
Primal
Dual
Minimize the total traffic cost needed to travel
from the source to the target city by city.
The transportation company, e.g., airline
company, want to maximize the price to take you
from the source to the target.
59Explanation for the Primal/Dual
Primal
Dual
The transportation fee between each pair of
cities must be cheap enough.
60Example
3
1
2
2
1
Primal
61Example
f1 f2 f3 f4 f5 Ans
1 1 0 0 0 1
?1 0 1 1 0 0
0 ?1 ?1 0 1 0
1 2 2 3 1 0
f1 f2 f3 f4 f5 Ans
1 1 0 0 0 1
0 1 1 1 0 1
0 ?1 ?1 0 1 0
1 2 2 3 1 0
f1 f2 f3 f4 f5 Ans
1 1 0 0 0 1
0 1 1 1 0 1
0 ?1 ?1 0 1 0
0 ?1 0 0 0 ?4
f1 f2 f3 f4 f5 Ans
1 1 0 0 0 1
0 1 1 1 0 1
0 ?1 ?1 0 1 0
0 ?1 0 0 0 ?4
62Example
f1 f2 f3 f4 f5 Ans
1 0 ?1 ?1 0 0
0 1 1 1 0 1
0 0 0 1 1 1
0 0 1 1 0 ?3
f1 f2 f3 f4 f5 Ans
1 0 ?1 ?1 0 0
0 1 1 1 0 1
0 0 0 1 1 1
0 0 1 1 0 ?3
f1 f2 f3 f4 f5 Ans
1 1 0 0 0 1
0 1 1 1 0 1
0 ?1 ?1 0 1 0
0 ?1 0 0 0 ?4
63Example
The Primal
The Dual
64Example
3
3
1
f1 0
f2 1
The optimum
f3 0
f5 1
f4 0
Complementary Slackness
The optimum
?1 3
?2 3
?3 1
65Duality
- Dual Information
- in the Tableau
??????? ?????????
66The Optima for Primal Dual
?
x
found by applying the primal simplex algorithm on
a tableau.
Can we find the duals optimum from the tableau?
67The Criterion of Primal Algorithm
68The Criterion of Primal Algorithm
x(x1, ..., xn) Ans
A b
c 0
x(x1, ..., xn) Ans
B?1A B?1b
Primal Algorithm
Consider AI H.
69The Criterion of Primal Algorithm
x(x1, ..., xn) Ans
A b
c 0
x(x1, ..., xn) Ans
B?1A B?1b
Primal Algorithm
x(x1, ..., xn) Ans
I H b
c 0
x(x1, ..., xn) Ans
B?1 B?1H B?1b
Primal Algorithm
70Dual Information in the Tableau
x(x1, ..., xn) Ans
I H b
c 0
x(x1, ..., xn) Ans
B?1 B?1H B?1b
Primal Algorithm
71The Inverse Matrix
At the end of simplex algorithm, the inverse
matrix will appear at the place of the original
identity.
x(x1, ..., xn) Ans
I H b
c 0
x(x1, ..., xn) Ans
B?1 B?1H B?1b
Primal Algorithm
72Example
Phase I
73Phase I
x1 x2 x3 x4 x5 x6 x7 x8 Ans
3 2 1 0 0 1 0 0 1
5 1 1 1 0 0 1 0 3
2 5 1 0 1 0 0 1 4
0 0 0 0 0 1 1 1 0
74Phase I
x1 x2 x3 x4 x5 x6 x7 x8 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 x2 x3 x4 x5 x6 x7 x8 Ans
1.5 1 0.5 0 0 0.5 0 0 0.5
3.5 0 0.5 1 0 ?0.5 1 0 2.5
?5.5 0 ?1.5 0 1 ?2.5 0 1 1.5
1.5 0 1.5 0 0 2.5 ?1 ?1 ?4.5
B?1
x1 x2 x3 x4 x5 x6 x7 x8 Ans
1.5 1 0.5 0 0 0.5 0 0 0.5
3.5 0 0.5 1 0 ?0.5 1 0 2.5
?5.5 0 ?1.5 0 1 ?2.5 0 1 1.5
x1 x2 x3 x4 x5 x6 x7 x8 Ans
1.5 1 0.5 0 0 0.5 0 0 0.5
3.5 0 0.5 1 0 ?0.5 1 0 2.5
?5.5 0 ?1.5 0 1 ?2.5 0 1 1.5
1 1 1 1 1 0 0 0 0
78Duality
- The Dual
- Simplex Algorithm
??????? ?????????
79The Criterion of Primal Algorithm
80The Feasibility of the Dual
Unrestricted
81The Primal Algorithm
Unrestricted
Initial Tableau
x(x1, ..., xn) Ans
H I b?0
c 0
82The Primal Algorithm
Unrestricted
The primal algorithm starts from a feasible
solution of the primal.
Initial Tableau
x(x1, ..., xn) Ans
H I b?0
c 0
83The Primal Algorithm
Unrestricted
Initial Tableau
Final Tableau
x(x1, ..., xn) Ans
H I b?0
c 0
x(x1, ..., xn) Ans
. . . b?0
84The Primal Algorithm
Optimal and Feasible.
Unrestricted
Initial Tableau
Final Tableau
x(x1, ..., xn) Ans
H I b?0
c 0
x(x1, ..., xn) Ans
. . . b?0
85The Feasibility of the Dual
Unrestricted
The feasible solution of the dual can be read
here.
Initial Tableau
Final Tableau
x(x1, ..., xn) Ans
H I b?0
c 0
x(x1, ..., xn) Ans
. . . b?0
86What the Primal Algorithm Done?
Maintaining the primal feasible solution and
working towards dual feasibility.
Unrestricted
87The Primal/Dual Simplex Algorithms
- The Primal Simplex Algorithm
- Maintaining the primal feasible solution and
working towards dual feasibility. - The Dual Simplex Algorithm
- Maintaining the dual feasible solution and
working towards primal feasibility.
88The Primal/Dual Simplex Algorithms
- The Primal Simplex Algorithm
- Maintaining the primal feasible solution and
working towards dual feasibility. - The Dual Simplex Algorithm
- Maintaining the dual feasible solution and
working towards primal feasibility.
89The Dual Simplex Algorithms
x1 ? xj ? xn?m xn?m1 ? xn?mj ? xn Ans
a11 ? a1j ? a1,n?m 1 ? 0 ? 0 b1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ai1 ? aij ? ai,n?m 0 ? 1 ? 0 bi
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
am1 ? amj ? am,n?m 0 ? 0 ? 1 bm
c1 ? cj ? cn?m 0 ? 0 ? 0 ??0
Keep all elements in it non-negative.
The dual wants to maximize ?. Hence, to minimize
the value ?? appearing here.
90The Dual Simplex Algorithms
x1 ? xj ? xn?m xn?m1 ? xn?mj ? xn Ans
a11 ? a1j ? a1,n?m 1 ? 0 ? 0 b1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ai1 ? aij ? ai,n?m 0 ? 1 ? 0 bi
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
am1 ? amj ? am,n?m 0 ? 0 ? 1 bm
c1 ? cj ? cn?m 0 ? 0 ? 0 ??0
When all elements in it become non-negative, we
reach the primal feasibility.
91Select Pivot Row
How about if none of bis is negative?
x1 ? xj ? xn?m xn?m1 ? xn?mj ? xn Ans
a11 ? a1j ? a1,n?m 1 ? 0 ? 0 b1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ai1 ? aij ? ai,n?m 0 ? 1 ? 0 bi
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
am1 ? amj ? am,n?m 0 ? 0 ? 1 bm
c1 ? cj ? cn?m 0 ? 0 ? 0 ??0
Choose the row with most negative bi entry as the
pivot row, say the ith row.
92Select the Pivot
How about if none of aijs is negative?
x1 ? xj ? xn?m xn?m1 ? xn?mj ? xn Ans
a11 ? a1j ? a1,n?m 1 ? 0 ? 0 b1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ai1 ? aij ? ai,n?m 0 ? 1 ? 0 bi
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
am1 ? amj ? am,n?m 0 ? 0 ? 1 bm
c1 ? cj ? cn?m 0 ? 0 ? 0 ??0
The pivot column is determined by choosing
the maximum here, say the jth column.
Compute this term only for aij's that are
negative.
?
?
93Pivoting
x1 ? xj ? xn?m xn?m1 ? xn?mj ? xn Ans
? 0 1 ? ? 0
. . . . . . . . . . . . . . . . . . . . .
? 1 0 ? ? 0
. . . . . . . . . . . . . . . . . . . . .
? 0 0 ? ? 1
0 0 ? ? 0
x1 ? xj ? xn?m xn?m1 ? xn?mj ? xn Ans
a11 ? a1j ? a1,n?m 1 ? 0 ? 0 b1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ai1 ? aij ? ai,n?m 0 ? 1 ? 0 bi
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
am1 ? amj ? am,n?m 0 ? 0 ? 1 bm
c1 ? cj ? cn?m 0 ? 0 ? 0 ??0
Repeat the aforementioned procedure until the
primal feasibility is reached or the infeasible
or unbounded condition becomes obviously.
94Example
f1 f2 f3 f4 f5 Ans
1 1 0 0 0 1
?1 0 1 0 ?1 ?1
0 0 0 1 1 1
1 0 0 0 0 ?3
95Select Pivot Row
f1 f2 f3 f4 f5 Ans
1 1 0 0 0 1
?1 0 1 0 ?1 ?1
0 0 0 1 1 1
1 0 0 0 0 ?3
Pivot Row
96Select the Pivot
f1 f2 f3 f4 f5 Ans
1 1 0 0 0 1
?1 0 1 0 ?1 ?1
0 0 0 1 1 1
1 0 0 0 0 ?3
Pivot Row
Choose maximum
97Pivoting
f1 f2 f3 f4 f5 Ans
1 1 0 0 0 1
?1 0 1 0 ?1 ?1
0 0 0 1 1 1
1 0 0 0 0 ?3
f1 f2 f3 f4 f5 Ans
1 1 0 0 0 1
1 0 ?1 0 1 1
?1 0 1 1 0 0
1 0 0 0 0 ?3
f1 f2 f3 f4 f5 Ans
1 1 0 0 0 1
1 0 ?1 0 1 1
?1 0 1 1 0 0
1 0 0 0 0 ?3
The Optimum