Presentation is loading. Please wait.

Presentation is loading. Please wait.

Maximum Flow Problem Definitions and notations The Ford-Fulkerson method.

Similar presentations


Presentation on theme: "Maximum Flow Problem Definitions and notations The Ford-Fulkerson method."— Presentation transcript:

1 Maximum Flow Problem Definitions and notations The Ford-Fulkerson method

2 Flow Networks

3 Flow Given a flow network G=(V,E) with capacity function c. Let s be the source and t the sink. A flow in G is a real-valued function f: V×V  R satisfying the following three properties: Capacity constraint: For all u,v  V, f(u,v)  c( u,v). Skew symmetry: For all u,v  V, f(u,v) = -f(v, u). Flow conservation: For all u  V-{s,t}, If (u, v)  E, and (v, u)  E, then we must have f (u, v) = f (v, u) = 0. By skew symmetry, for all v  V-{s,t},

4 Value of a Flow The value of a flow is defined as

5 Maximum-flow Problem Input: a flow network G with source s and sink t. Output: a flow of maximum value

6 Working with Flows If X and Y are sets of vertices in a flow network, then The flow conversation property can be expressed as for all u  V-{s,t}

7 Working with Flows

8 Maximum-flow Problem Input: a flow network G with source s and sink t Output: a flow of maximum value How to solve it efficiently?

9 The Ford-Fulkerson Method Why “method” not “algorithm”? The Ford-Fulkerson method depends on three important ideas: Residual Network, Augmenting Path, and Cut. These ideas are essential to the important max-flow min-cut theorem, which characterizes the value of maximum flow in terms of cuts of the flow network.

10 The Ford-Fulkerson Method FORD-FULKERSON-METHOD(G, s, t) 1.initialize flow f to 0 2.while there exists an augmenting path p 3. do augment flow f along p 4.return f

11 Residual Networks Given a flow network and a flow, the residual network consists of edges that can admit more flow. More formally, given: G=(V, E): a flow network with source s and sink t f: a flow in G. the residual capacity of (u,v), given by: c f (u,v) = c(u,v) - f(u,v) Residual network: G f = (V, E f ), where E f ={(u,v)  V × V: c f (u,v) > 0}

12 Residual Networks (example)

13 The relationship between a flow in a residual network and one in the original network *

14 Augmenting paths Given a flow network G=(V, E) and a flow f, an augmenting path is a simple path from s to t in the residual network G f. Residual capacity of p : the maximum amount by which we can increase the flow along the edges of an augmenting path p, i.e., c f (p) = min { c f (u,v): (u,v) is on p}. 23 1 The residual capacity is 1.

15 Augmenting Path (example)

16 Augmenting Path

17 Cut Cut (S, T): S is a subset of V, T =V-S, s  S and t  T. Net flow across the cut (S,T): f(S,T) Capacity of the cut (S,T): c(S,T) Minimum cut of a network:

18 Cut

19

20

21 The Basic Ford-Fulkerson Algorithm

22

23 Analysis of the algorithm The running time of the algorithm depends on how the augmenting path is determined. If it is chosen poorly, the algorithm even dose not terminate. If the capacities are integers, the time complexity is O(E f*), where f* is the value of a maximum flow. If we use breadth-first search to find the augmenting path, we can improve the time complexity to O(VE 2 ) (Edmonds-Karp algorithm)

24 The Edmonds-Karp algorithm Lemma 26.8 If the Edmonds-Karp algorithm is run on a flow network G = (V, E) with source s and sink t, then fro all vertices v  V-{s,t}, the shortest-path distance  f(s, v) in the residual network Gf increases monotonically with each flow augmentation.

25 Edmonds-Karp algorithm Theorem 26.9 If the Edmonds-Karp algorithm is run on a flow network G = (V, E) with source s and sink t, then the total number of flow augmentations performed by the algorithm is O(VE).

26 An example 1000 1 s t b

27


Download ppt "Maximum Flow Problem Definitions and notations The Ford-Fulkerson method."

Similar presentations


Ads by Google