20
Maximum Flow Algorithms —— ACM 黄黄黄

Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm

Embed Size (px)

Citation preview

Page 1: Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm

Maximum Flow Algorithms—— ACM 黄宇翔

Page 2: Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm

目录 Max-flow min-cut theorem1

2 Augmenting path algorithms

3 Push-relabel maximum flow algorithm

Page 3: Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 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

Page 4: Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm

Residual Network

for a flow f in a flow network G, define residual capacity as cf (u, v) = c (u, v) - f (u, v)

Page 5: Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm

Augment path

Page 6: Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm

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 |

Page 7: Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm

CutDefinitions :

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)

Page 8: Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm

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

Page 9: Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm

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)

Page 10: Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm

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))

Page 11: Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm

Push-relabel maximum flow algorithm

Page 12: Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm

Push-relabel maximum flow algorithm

Page 13: Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm

Push-relabel maximum flow algorithm

Page 14: Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm

Push-relabel maximum flow algorithm

Page 15: Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm

Push-relabel maximum flow algorithm

Page 16: Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm

Push-relabel maximum flow algorithm

Page 17: Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm

Push-relabel maximum flow algorithm

Page 18: Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm

Push-relabel maximum flow algorithm

Page 19: Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm

Push-relabel maximum flow algorithm

Page 20: Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm

Thanks for listening23/4/20