Presentation is loading. Please wait.

Presentation is loading. Please wait.

Max Flow min Cut.

Similar presentations


Presentation on theme: "Max Flow min Cut."— Presentation transcript:

1 Max Flow min Cut

2 Max Flow/Min Cut

3 Problem

4 Definitions Capacity 7 Sink Source

5 A Flow 3 5 7 2

6 A Cut

7 Capacity/Flow Across A Cut

8 Problem Find a cut with minimum capacity
Find maximum flow from source to sink

9 More Definition: Residual Graph
3 5 7 2 5 2

10 Augmenting Path A path from source to sink in the residual graph of a given flow

11 Idea If there is an augmenting path in the residual graph, we can push more flow

12 Ford-Fulkerson Method
initialize total flow to 0 residual graph G’= G while augmenting path exist in G’ pick a augmenting path P in G’ m = bottleneck capacity of P add m to total flow push flow of m along P update G’

13 Example 3 2 1 3 1 3 1 1 3 1 1 4 3 2 2 1 1 1 2 4 2 4

14 Example 3 2 1 3 1 3 1 1 3 1 1 4 3 2 2 1 1 1 2 4 2 4

15 Example 3 2 1 3 1 3 1 1 3 1 1 4 3 2 2 1 1 1 2 3 1 3 1 1 1

16 Example 3 2 1 3 1 3 1 1 3 1 1 4 3 2 2 1 1 1 2 3 1 3 1 1 1

17 Example 1 2 1 3 1 1 1 1 1 1 1 4 3 2 2 1 1 1 2 3 1 3 1 1 1

18 Example 1 2 1 3 1 1 1 1 1 1 1 4 3 2 2 1 1 1 2 3 1 3 1 1 1

19 Example 1 2 1 3 1 1 1 1 1 1 1 3 3 2 1 1 1 1 2 2 2 2 2 2

20 Answer: Max Flow = 4 2 2 2 2 2 1 1 1 2 2 2

21 Answer: Minimum Cut = 4 3 2 1 3 1 3 1 1 3 1 1 4 3 2 2 1 1 1 2 4 2 4

22 Find Augmenting Path? initialize total flow to 0 residual graph G’= G
while augmenting path exist in G’ pick a augmenting path P in G’ m = bottleneck capacity of P add m to total flow push flow of m along P update G’

23 Picking Augmenting Path
Edmonds-Karp’s Heuristics Find a path with maximum bottleneck capacity Find a path with minimum length

24 Variations How about Maximum Cut?

25 Applications for MaxFlow/MinCut

26 Application: Bipartite Matching
Marriage Problem BTW, how to determine if a graph is bipartite?

27 A Matching

28 Maximum Matching

29 Maximum Flow Problem

30 Maximum Flow/Matching

31 Minimum Vertex Cover Bipartite Graph
5 2 1 2 4 3 2 3 4 2

32 A Vertex Cover (W=15) 5 2 1 2 4 3 2 3 4 2

33 Maximum Flow 5 2 1 2 4 3 2 3 4 2

34 Finite Cut = Vertex Cover
5 2 1 2 4 3 2 3 4 2

35 Finite Cut = Vertex Cover

36 Problems..

37 Problem 1: Optimal Protein Sequence
Given a 2D geometric structure of a protein, with n residuals

38 Optimal Protein Sequence
Each residual can be either hydrophobic (H) or polar (P)

39 Optimal Sequence Each residual has a “solvent area”
Want to reduce solvent areas of Hs Want to increase pairs of Hs in close contacts

40 Optimal Sequence Assign H, P to the residuals to minimize
d(i,j): 1 if H at position i and H at position j is close enough, 0 otherwise s(i) : area exposed at position i

41 Problem 2: Forest Clearence
cannot clear two adjacent square! profit for cutting trees 5 10 8 12 which squares to clear to maximize profit?

42 Problem 3: All-Pair Maximum Bottleneck Bandwidth Path
Given a graph, how to find the maximum bottleneck bandwidth path between any two nodes, u and v, efficiently?


Download ppt "Max Flow min Cut."

Similar presentations


Ads by Google