210 likes | 330 Views
Learn about maximum flow algorithms, max-flow min-cut theorem, augmenting path algorithms, and the push-relabel maximum flow algorithm with detailed explanations and examples.
E N D
Maximum Flow Algorithms —— ACM 黄宇翔
1 2 3 目录 Max-flow min-cut theorem Augmenting path algorithms Push-relabel maximum flow algorithm
Maximum flow problem • source : s, sink : t • for any (u, v), (v, u) does not exist and c(u, v) > 0 • for any vertex v, there's a path s→v→t • the flow f : V × V → R, satisfies two properties : • for any (u, v), 0 ≤ f (u, v) ≤ c (u, v) • for any u ∈ V - {s, t}, ∑ f (u, v) = ∑ f (v, u) • | f | = ∑ f (s, v) - ∑ f (v, s), we want it max
Residual Network for a flow f in a flow network G, define residual capacity as cf (u, v) = c (u, v) - f (u, v)
Lemma • f is a flow on G • Gf is the residual network induced from f • Δf is a flow on Gf • we define a new flow on G : f ↑ Δf • for any (u, v), (f ↑ Δf) (u, v) = f (u, v) + Δf (u, v) - Δf (v, u) • then we have : | f ↑ Δf | = | f | + | Δf |
Cut • Definitions : • a cut (S, T) is a partition of V which satisfies : s ∈ S and t ∈ T • f (S, T) = ∑ ∑ f (u, v) - ∑ ∑ f (v, u) • c (S, T) = ∑ ∑ c (u, v) Properties : • for any cut (S, T), f (S, T) = | f | • for any cut (S, T), f (S, T) ≤ c (S, T)
Max-flow min-cut theorem • The following statements are equivalent : • f is a max flow of G • There's no augmenting path in Gf • There exists a cut (S, T) satisfies | f | = c (S, T) Proof has been mentioned above
Augmenting path algorithms • Ford-Fulkerson : O ( E | f* | ) • Edmonds-Karp : O ( V E2 ) • SAP (= shortest augmenting path) : O ( V2 E ) • Dinic : O ( V2 E ) • ISAP (= improved shortest augmenting path) : O ( V2 E ) (GAP)
Push-relabel maximum flow algorithm • preflow : for any v ∈ V, ∑ f (v, u) - ∑ f (u, v) ≥ 0 • excess flow e (u) = ∑ f (v, u) - ∑ f (u, v) • h (u) : the shortest distance to t • Push (u, v) // when e (u) > 0, cf (u, v) > 0, and u.h = v.h + 1 Δf (u, v) = min (e (u), cf (u, v)) if (u, v) ∈ E f (u, v) += Δf (u, v) else f (u, v) -= Δf (u, v) e (u) -= Δf (u, v) v (u) += Δf (u, v) • Relabel (u) // when e (u) > 0, for all (u, v) ∈ Ef, h (u) <= h (v) h (u) = min (h (v))
Thanks for listening 2020/1/4