Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 10 Network flow Max-flow and Min-cut Ford-Fulkerson method

Similar presentations


Presentation on theme: "Lecture 10 Network flow Max-flow and Min-cut Ford-Fulkerson method"— Presentation transcript:

1 Lecture 10 Network flow Max-flow and Min-cut Ford-Fulkerson method
Applications

2 Roadmap Max-flow and Min-cut Ford-Fulkerson methods Applications

3 History First formulated in 1954 by T.E. Harris as a simplified model of Soviet Railway traffic flow. In 1955, L. Ford and D. Fulkerson created the first known algorithm --- Ford-Fulkerson algorithm. Over the years, various improved solutions to the maximum flow problem were discovered: Edmonds and Karp Dinitz (Dinic) Goldberg and Tarjan ...... rail network connecting Soviet Union with Eastern European countries (map declassified by Pentagon in 1999)

4 Flow Networks A flow network is 1. a directed graph G<V,E>,
2. Weights on edges denote the capacities. 3. Two distinguished vertex: s and t, denoting source and sink. Definition: st-FlowA function f : V×V→R is a st-flow (flow) if satisfying: ∀u,v∈V. f(u,v) = −f(v,u). ∀u,v∈V. f(u,v) ≤ c(u,v). ∀u ∈V\{s,t}. ∑v∈Vf(u,v) = 0. ∀v∈V. f(v,v)=0. The value of a flow f: |f| = f(s,V) = ∑v∈Vf(s,v) |f| ≥ 0

5 Maximum flow Problem: Maxflow
Input: A network G(V, E), s, t, and capacity function c. Output: The flow with maximum value. 2 1 2 2 max |f| = 7 1 1 5 4 5

6 Minimum Cut Lemma Definition: Cut
A cut {S,T} is a partition of the vertex set V into two subsets S and T such that s ∈ S and t ∈ T. The capacity of the cut {S,T}, denoted by c(S,T), is c(S,T)= ∑u∈S,v∈T c(u,v) Lemma For any cut {S,T} and a flow f , |f| = f(S,T) ≤ c(S,T).

7 Quiz Compute the maximum flow and minimum cut of the following graphs.
A B C D. 2,000,000

8 Where are we? Max-flow and Min-cut Ford-Fulkerson methods Applications

9 Ef = {(u,v) | r(u,v) > 0} where r(u,v)=c(u,v)−f(u,v)
Residual graph The residual graph for the flow f is the directed graph R = (V, Ef ), with capacities defined by r and Ef = {(u,v) | r(u,v) > 0} where r(u,v)=c(u,v)−f(u,v) 1 1 1 2 1 1 10 1 2 1 2 2 1 1 1 1 4 4 4 4 1 4 4 1 1

10 |f + f’| = |f|+|f′| > |f|.
Flow in residual graph 1 1 1 2 1 1 10 1 2 1 2 2 1 1 1 1 4 4 4 4 1 4 4 1 Lemma Let f be a flow in G and f′ the flow in the residual graph R for f. Then the function f +f′ is a flow in G of value |f + f’| = |f|+|f′| > |f|.

11 Augmenting path Definition: AugmentingPath
Given a flow in G, an augmenting path p is a directed path from s to t in the residual graph R. The bottleneck capacity of p is the minimum residual capacity along p. The number of edges in p will be denoted by |p|. 1 1 2 1 1 1 2 10 1 1 1 1 2 2 1 1 4 4 1 4 4 4 4 1

12 Max-flow-Min-cut theorem
Let (G,s,t,c) be a network and f a flow in G. The following three statements are equivalent:1. f is a maximum flow in G. 2. There is no augmenting path. 3. There is a cut {S,T} with c(S,T)=|f|.

13 Basic Ford-Fulkerson

14 Quiz Apply FF to the following graph to compute the maximum flow.

15 Questions How to compute a min-cut? How to find an augmenting path?
If FF terminates, does it always compute a maxflow? Does FF always terminate? If so, after how many augmentations?

16 Compute Min-cut (S,T) Compute the maximum network flow using FF
2 1 1 10 2 2 2 1 1 1 5 4 5 Compute the maximum network flow using FF There is no augmenting paths in final residual graph Gr. Compute S = set of vertices connected to s in Gr Compute T = V\S.

17 Questions How to compute a min-cut? How to find an augmenting path?
If FF terminates, does it always compute a maxflow? Does FF always terminate? If so, after how many augmentations? BFS works well. ✔ By Max-flow-Min-cut theorem. ✔

18 Ford-Fulkerson method
For integer capacities, Θ(m|f*|), where f* is the maximum flow. Ford-Fulkerson may NOT halt if the capacities are irrational, or may not converge to a value that is maximum. p0={s,v2,v3,t} p1={s,v4,v3,v2,v1,t} p2={s,v2,v3,v4,t} p3={s,v1,v2,v3,t} p0,p1,p2,p1,p3,p1,p2,....

19 Improvements by Edmonds and Karp
Maximum capacity augmentation: O(V2Elogc*) Shortest path augmentation: O(VE2)

20 Solutions Method Complexity O(E max| f |) O(V2Elogc*), O(VE2) O(V2E)
Ford–Fulkerson O(E max| f |) Edmonds–Karp O(V2Elogc*), O(VE2) Dinitz blocking flow O(V2E) General push-relabel maximum flow Push-relabel with FIFO vertex selection rule O(V3) Dinitz blocking flow with dynamic trees O(VE log(V)) Push-relabel with dynamic trees O(VE log(V2/E))

21 Conclusion Mincut problem. Find an st-cut of minimum capacity. Maxflow problem. Find an st-flow of maximum value. Duality. Value of the maxflow = capacity of mincut. Proven successful approaches. Ford-Fulkerson (various augmenting-path strategies). Preflow-push (various versions). Open research challenges. Practice: solve real-word maxflow/mincut problems in linear time. Theory: prove it for worst-case inputs.


Download ppt "Lecture 10 Network flow Max-flow and Min-cut Ford-Fulkerson method"

Similar presentations


Ads by Google