Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
= >
= =
j
i
to subject
minimize
Linear program
polynomial time solution in n,m
1-34
Example: optimal routes
topology G = (V,E)
K set of origin destination flows
k eK, d
k
demand, s
k
source, t
k
destination
set of given link weights {w
ij
: (i,j) eE }
fraction of flow k going over (i,j) eE
0
, 1
,
, 0 . .
min
) , ( :
) , ( : ) , ( :
) , (
>
=
e
=
=
e
=
e
e e
e e
k
ij
k
E j i j
k
ij
k k
E i j j
k
ji
E j i j
k
ij
K k E j i
k
ij ij
X
s i
K k
X
t s i
K k
X X t s
X w
k
ij
X
1-35
1-36
Example
decomposes into separate problems per
flow k eK
0
, 1
, , 0 . .
min
) , ( :
) , ( : ) , ( :
) , (
>
= =
= =
e
e e
e
k
ij
k
E j i j
k
ij
k k
E i j j
k
ji
E j i j
k
ij
E j i
k
ij ij
X
s i X
t s i X X t s
X w
1-37
Interpretation
let be optimal solutions
if takes values 0 and 1, corresponds
to shortest paths
if takes other values, there exist
multiple shortest paths.
{ }
k
ij
X
{ }
k
ij
X
{ }
k
ij
X
1-38
Linear Program
x
0
is feasible if Ax
0
= b and x
0
> 0
m j x
n i b x a
x c
j
i j i,j
j i
, , 1 , 0
, , 1 , subject to
minimize
j
i
= >
= =
, 0
subject to
minimize
>
=
x
b Ax
x c
T
1-39
Dual problem.
if {x
i
} and {y
i
} are optimal, then the
objective functions are equal
T T
T
c A y
b y
s subject to
maximize
=
i i
i i
* *
x c b y
i i
, 0
subject to
minimize
>
=
x
b Ax
x c
T
1-40
Dual problem: properties.
if x and y are feasible, then c
T
x > y
T
b
if x and y are feasible and if c
T
x > y
T
b,
then x and y are optimal
if either problem has finite solution, so
does other, if either has unbounded
solution, so does other
1-41
Complementary slackness.
Let x and y be feasible solutions. A necessary
and sufficient condition for them to be
optimal is that for all i
1. x
i
> 0 y
T
A
i
= c
i
2. x
i
= 0 : y
T
A
i
< c
i
Here A
i
is i-th column of A
1-42
Example: primal (P-SP)
0
, 1
,
, 0 . .
min
) , ( :
) , ( : ) , ( :
) , (
>
=
e
=
=
e
=
e
e e
e e
k
ij
k
E j i j
k
ij
k k
E i j j
k
ji
E j i j
k
ij
K k E j i
k
ij ij
X
s i
K k
X
t s i
K k
X X t s
X w
1-43
Example: dual (D-SP)
K k U
E j i
K k
w U U t s
U
k
s
ij
k
i
k
j
K k
k
t
k
k
e =
e
e
s
e
, 0
) , (
, . .
max
1-44
Example
optimal solution to dual problem
shortest distance from s
k
to i
length of shortest path from s
k
to t
k
{ }
k
i
U
K k U
E j i
K k
w U U t s
U
k
s
ij
k
i
k
j
K k
k
t
k
k
e =
e
e
s
e
, 0
) , (
, . .
max
k
i
U
k
t
k
U
1-45
Optimal route selection