Advanced Algorithms Lecture 10.0
Advanced Algorithms Lecture 10.0
http://ocw.mit.edu
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
18.415/6.854 Advanced Algorithms October 17, 2001
Lecture 10
Lecturer: Michel X. Goemans Scribe: Ashish Koul
Proof: i j ii and iii +- i were proven last lecture. All that remains is the proof of ii +- iii:
Let G' be obtained from the residual graph Gf by adding a vertex s linked t o all other vertices by
edges of cost 0 (the costs of these edges do not matter). Let p(u) be the length of the shortest path
from s to v in G' with respect to the costs.
These quantities are well-defined since Gf does not contain any negative cost directed cycles, and
+
every vertex is reachable from s. By definition of the shortest paths, p(w) 5 p(u) c(u,w) V(u,w) E
>
Ef. This implies that cp(u,w) 0 V(u,w) E Ef.
If the algorithm terminates, then the circulation found must be optimum. Furthermore, if all ca-
pacities and costs are integers, then the algorithm will terminate.
Why?
f (v, w) is always an integer, thus 6 = min(,,,)Er uf(u,w) 2 1
If Ic(u,w) I 5 C and If (u,w) 1 5 U , then the absolute value of the cost of the optimal circulation
is at most mCU
Therefore, the algorithm terminates after 0 (mCU) iterations.
Remark 1 If the edge capacities i n the graph are irrational, then the algorithm is not correct.
The cycle canceling algorithm can be applied to the Max-Flow Problem by making appropriate
modifications to the graph G. Let G' be obtained by setting the cost of all edges within G to 0.
Furthermore, select two vertices s and t from within the graph, and add the directed edges (s, t )
and (t,s), where c(s, t ) = 1,c(t, s) = -1 and both edges have infinite capacity. Now, solving for
the maximum flow between s to t is equivalent to solving for the minimum cost circulation, which
contains s and t. In this circumstance, Klein's Algorithm reduces to the Ford-Fulkerson Algorithm.
where Irl denotes the number of edges in r. The minimum mean cost of all cycles of the
residual graph Gf would thus be:
min c(r)
-
'(') = cycles T. in G~ lr 1
The minimum mean-cost cycle can be determined in strongly polynomial time by using a
modified version of the Bellman-Ford Algorithm. More precisely, the minimum mean cost
cycle can be found in O(mn) time. Using this method to solve the Min-Cost Circulation
Problem yields the Goldberg-Tarjan Algorithm, which runs in polynomial time. Using this
method to solve the Max-Flow Problem yields what is known as the "shortest" augmenting
path algorithm (Edmonds-Karp). This Max-Flow Algorithm is able to find the augmenting
path in O(m) time, and requires O(mn) iterations to arrive at the solution. Thus, the total
running time is 0(m2n) .
3 The Goldberg-Tarjan Algorithm
Goldberg-Tarjan Algorithm:
1. Begin with zero flow: f = 0.
2. While p(f) < 0 do
push 6 = min(,,,),I- uf (u, w) along a minimum mean cost cycle r of Gf .
Analysis of Goldberg-Tarjan Algorithm:
In order to analyze this algorithm, it is necessary to define the concept of proximity measure for a
circulation f .
Definition 2 ~ ( f =
) minimum E such that f is E-optimal.
The following theorem states that the minimum mean cost p( f ) of all cycles in Gf is equal to -E( f ) ,
as defined above.
Proof:
~ ( f 2) - 4 f )
>
By definition, there exists p such that cp(u,w) -E( f ) V(v,w) E Ef . Thus, it is implied that
cP(r) 2 -~(f)lI'l for any directed cycle r E G f . But for any I' E G f , c ( r ) = cp(r). Thus,
dividing both sides by Irl yields that the mean cost of any directed cycle I' E Gf is at least
- ~ ( f ) .Therefore, p(f) 2 - ~ ( f ) .
4 61 I-4f 1
Consider p(f). For every cycle r E G f , it is the case that >
p(f). Let cl(v,w) =
C(U,W) - p(f ) V(u, W) E Ef . With respect to this new cost function c' every cycle I' E Gf
will have nonnegative cost. Now, let G' be obtained by adding a new node s to Gf and
adding directed edges from s to u Vu E V, all with zero cost. Let p(u) be the cost with
respect to c' of the shortest path from s to u in the new graph G'. For all edges (u,w),
>
p(w) Ip(u)+c'(u,w) =p(u)+c(u,w)-p(f). This implies that cp(v,w) p(f) V(u,w) E Ef.
Therefore, ~ ( f 5
) -p(f).
Remark 2 Along the minimum mean cost cycle I', cp(v,w) = -E( f ) V(v,w) E I'.
Having completed the necessary definitions and proofs, we may now proceed with the analysis of the
Goldberg-Tarjan Algorithm. The following theorem considers only one iteration of the algorithm.
Theorem 3 Let f be a circulation and let f ' be the circulation obtained b y canceling the minimum
<
mean cost cycle I' of Gf . Then, E(f ') E(f ) .
>
Proof: By definition, there existspsuch that cp(u,w) - ~ ( f )V(u,w) E E f . In the caseof the
minimum mean cost cycle I' of Gf , cp(u,w) = -E( f ) V(u,w) E I?. After performing the one cycle-
>
canceling step, we obtain the new residual graph Gft . We claim that cp(u,w) - ~ ( f )V(v,w) E Ef,.
n
In the case of all edges (u,w) E Eft Ef, the claim is certainly true. In the case of all edges
(u,w) E Ef/\Ef,it must be true that (w,u) E I?. For all (w,v) E I?, cp(w,u) = - ~ ( f ) ,and thus
cP(v,w) = ~ ( f 2
) - ~ ( f ) . Therefore, c,(u,w) 2 - ~ ( f )holds true for all (v,w) E E f , .
The above theorem shows that by completing a single iteration of the Goldberg-Tarjan algorithm,
it is impossible to generate a new flow which is farther from optimality than the original.