Chapter 16
Network Flow V  Mincost flow
By
Sariel HarPeled
, October 19, 2007
Version: 1.01
16.1
Minimum Average Cost Cycle
Let
G
=
(
V
,
E
) be a
digraph
(i.e., a directed graph) with
n
vertices and
m
edges, and
ω
:
E
→
IR be
a weight function on the edges. A
directed cycle
is closed walk
C
=
(
v
0
,
v
1
, . . . ,
v
t
), where
v
t
=
v
0
and (
v
i
→
v
i
+
1
)
∈
E
, for
i
=
0
, . . . ,
t

1. The
average cost of a directed cycle
is AvgCost(
C
)
=
ω
(
C
)
/
t
=
(∑
e
∈
C
ω
(
e
)
)
/
t
.
For each
k
=
0
,
1
, . . .
, and
v
∈
V
, let
d
k
(
v
) denote the minimum length of a walk with exactly
k
edges, ending at
v
. So, for each
v
, we have
d
0
(
v
)
=
0
and
d
k
+
1
(
v
)
=
min
e
=
(
u
→
v
)
∈
E
d
k
(
u
)
+
ω
(
e
)
.
Thus, we can compute
d
i
(
v
), for
i
=
0
, . . . ,
n
and
v
∈
V
(
G
) in
O
(
nm
) time using dynamic program
ming.
Let
AvgCost
min
(
G
)
=
min
C
is a cycle in
G
AvgCost(
C
)
denote the average cost of the
minimum average cost cycle
in
G
.
The following theorem is somewhat surprising.
Theorem 16.1.1
The minimum average cost of a directed cycle in
G
is equal to
α
=
min
v
∈
V
n

1
max
k
=
0
d
n
(
v
)

d
k
(
v
)
n

k
.
Namely,
α
=
AvgCost
min
(
G
)
.
Proof:
Note, that adding a quantity
r
to the weight of every edge of
G
increases the average
cost of a cycle AvgCost(
C
) by
r
. Similarly,
α
would also increase by
r
. In particular, we can
assume that the price of the minimum average cost cycle is zero. This implies that now all cycles
have nonnegative (average) cost.
This work is licensed under the Creative Commons AttributionNoncommercial 3.0 License. To view a copy of
this license, visit
http://creativecommons.org/licenses/bync/3.0/
or send a letter to Creative Commons,
171 Second Street, Suite 300, San Francisco, California, 94105, USA.
1
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
π
v
σ
Figure 16.1:
Decomposing
P
n
into a path
σ
and a cycle
π
.
Assume, that
α
is realized by a vertex
v
. Let
P
n
be a walk
with
n
edges ending at
v
, of length
d
n
(
v
).
Since there are
n
vertices in
G
, it must be that
P
n
must contain a cycle. So, let
us decompose
P
n
into a cycle
π
of length
n

k
and a path
σ
of
length
k
(
k
depends on the length of the cycle in
P
n
). We have
that
d
n
(
v
)
=
ω
(
P
n
)
=
ω
(
π
)
+
ω
(
σ
)
≥
ω
(
σ
)
≥
d
k
(
v
)
,
since
ω
(
π
)
≥
0 as
π
is a cycle. As such, we have
d
n
(
v
)

d
k
(
v
)
≥
0. Let
α
(
v
)
=
n

1
max
j
=
0
d
n
(
v
)

d
j
(
v
)
n

j
≥
d
n
(
v
)

d
k
(
v
)
n

k
≥
0
.
Now,
α
=
min
v
α
(
v
)
≥
0.
v
0
ξ
w
τ
ρ
C
Next, we prove that
α
≤
0. Let
C
=
(
v
0
,
v
1
, . . . ,
v
t
) be the directed
cycle of weight 0 in the graph. Observe, that min
∞
j
=
0
d
j
(
v
0
) must be
realized by an index
r
<
n
, since if it is longer, we can always shorten
it by removing cycles and improve its price (since cycles have non
negative price). Let
ξ
denote this walk of length
r
ending at
v
0
. Let
w
be a vertex on
C
reached by walking
n

r
edges on
C
starting from
v
0
,
and let
τ
denote this walk (i.e.,

τ

=
n

r
). We have that
d
n
(
w
)
≤
ω ξ

τ
=
d
r
(
v
0
)
+
ω
(
τ
)
,
(16.1)
where
ξ

τ
denotes the path formed by concatenating the path
τ
to
ξ
.
Similarly, let
ρ
be the walk formed by walking on
C
from
w
all the way back to
v
0
. Note that
τ

ρ
goes around
C
several times, and as such,
ω
(
τ

ρ
)
=
0, as
ω
(
C
)
=
0. Next, for any
k
,
since the shortest path with
k
edges arriving to
w
can be extended to a path that arrives to
v
0
, by
concatenating
ρ
to it, we have that
d
k
(
w
)
+
ω
(
ρ
)
≥
d
k
+

ρ

(
v
0
)
≥
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '08
 Viswanathan
 Algorithms, Shortest path problem, Maximum flow problem

Click to edit the document details