Download presentation
Presentation is loading. Please wait.
Published byGavin Richard Hall Modified over 8 years ago
1
Network Flows
2
Menger ’ s Theorem Theorem 7.1. (Menger [1927] ) Let G be a graph (directed or undirected), let s and t be two vertices, and k N. Then there are k edge-disjoint s-t-paths if and only if after deleting any k – 1edges t is still reachable from s.
3
Proof (directed case) Necessity is obvious. To prove sufficiency in the directed case, let (G, u, s, t) be a network with unit capacities u ≡1such that t is reachable from s even after deleting any k – 1 edges. This implies that the minimum capacity of an s-t-cut is at least k. By the Max-Flow-Min-Cut Theorem and Corollary 6.7 there is an integral s-t-flow of value at least k. By Theorem 6.8 this flow can be decomposed into integral flows on s-t-paths (and possibly some circuits). Since all capacities are 1 we must have at least k edge-disjoint s-t-paths.
4
Proof (undirected case) Necessity is obvious. Let G be an undirected graph with two vertices s and t such that t is reachable from s even after deleting any k – 1 edges.
5
Proof (undirected case) u v uv
6
Vertex-disjoint path We call two paths vertex-disjoint if they have no edge and no inner vertex in common (they may have one or two common endpoints).
7
Menger ’ s Theorem (2) Theorem 7.2. (Menger [1927] ) Let G be a graph (directed or undirected), let s and t be two non-adjacent vertices, and k N. Then there are k vertex-disjoint s-t-paths if and only if after deleting any k – 1vertices (distinct from s and t) t is still reachable from s.
8
Proof v0v0 v1v1 v
9
v0v0 v1v1 v Any set of k – 1 edges in the new graph whose deletion makes t unreachable from s implies a set of at most k – 1vertices in G whose deletion makes t unreachable from s. Moreover, edge-disjoint s-t-paths in the new graph corresponds to vertex-disjoint paths in the old one.
10
k-edge-connected Graph Corollary 7.3. ( Whitney [1932] ) An undirected graph G with at least two vertices is k-edge-connected if and only if for each pair s, t V(G) with s ≠ t there are k edge-disjoint s-t-paths. An undirected graph G with more than k vertices is k-connected if and only if for each pair s, t V(G) with s ≠ t there are k vertex- disjoint s-t-paths.
11
Proof To prove the second statement let G be an undirected graph with more than k vertices. If G has k −1 vertices whose deletion makes the graph disconnected, then it cannot have k vertex disjoint s-t-paths for each pair s, t V(G). Conversely, if G does not have k vertex-disjoint s-t-paths for some s, t V(G), then we consider two cases. If s and t are non-adjacent, then by the 2 nd Menger Theorem G has k −1 vertices whose deletion separates s and t. G is not k-connected.
12
Proof (s and t are adjacent) If s and t are joined by a set F of parallel edges. Then G – F has no k – |F| vertex-disjoint s-t-paths. (|F| ≥ 1) So by the 2 nd Menger Theorem it has a set X of k − |F| – 1 vertices whose deletion separates s and t. Let v V(G)\(X {s, t}). Then v cannot be reachable from s and from t in G – F – X. Say v is not reachable from t. Add vertex s to X. Then v and t are in different connected components of G – (X {s}). |X {s}| = k − |F| ≤ k – 1 G is not k-connected.
13
Directed Edge-Disjoint Paths Problem Instance: Two directed graphs (G, H) on the same vertices. Task: Find a family (P f ) f E(H) of edge-disjoint paths in G such that for each f = (t, s) in H, P f is an s-t-path. Such a family is called a solution of (G, H). We say that P f realizes f. The edges of G are called supply edges, the edges of H demand edges. A vertex incident to some demand edge is called a terminal.
14
Solvable instance Proposition 7.4. Let (G, H) be an instance of the Directed Edge-Disjoint Paths Problem where H is just a set of parallel edges and G + H is Eulerian. Then (G, H) has a solution.
15
Solvable instance Proposition 7.4. Let (G, H) be an instance of the Directed Edge-Disjoint Paths Problem where H is just a set of parallel edges and G + H is Eulerian. Then (G, H) has a solution. Proof (induction on number of parallel edges in H). Since G + H is Eulerian, every edge, in particular any f E(H), belong to some circuit C. We take C – F as the first part of our solution, delete C, and apply induction.
16
Ford-Fulkerson Algorithm Input: A network (G, u, s, t). Output: An s-t-flow f of maximum value.
17
Edmonds-Karp Algorithm Input: A network (G, u, s, t). Output: An s-t-flow f of maximum value.
18
Lemma Lemma 7.5. Let f 1, f 2,... be a sequence of flows such that f i+1 results from f i by augmenting along P i, where P i is a shortest f i -augmenting path. Then a) |E(P k )| ≤ | E(P k+1 )| for all k. b) |E(P k )| + 2 ≤ |E(P l )| for all k < l such that P k ∪ P l contains a pair of reverse edges.
19
|E(P k )| ≤ | E(P k+1 )| for all k Consider the graph G 1, which results from P k P k+1 by deleting pairs of reverse edges. (Edges appearing both in P k and P k+1 are taken twice.)
20
Graph G 1 S t G 1 =P k U P k+1 − {reverse edges} G1G1
21
Proof a) Consider the graph G 1, which results from P k P k+1 by deleting pairs of reverse edges. (Edges appearing both in P k and P k+1 are taken twice.) Note that E(G 1 ) E(G f k ), since any edge in E(G f k+1 )\E(G f k ) must be the reverse of an edge in P k.
22
Proof a) Consider the graph G 1, which results from P k P k+1 by deleting pairs of reverse edges. (Edges appearing both in P k and P k+1 are taken twice.) Note that E(G 1 ) E(G f k ), since any edge in E(G f k+1 )\E(G f k ) must be the reverse of an edge in P k. Let H 1 simply consists of two copies of (t,s). Obviously G 1 + H 1 is Eulerian.
23
G 1 + H 1 S t G 1 =P k U P k+1 − reverse edges H 1 − two edges (t,s) G1G1
24
Proof a) Consider the graph G 1, which results from P k P k+1 by deleting pairs of reverse edges. (Edges appearing both in P k and P k+1 are taken twice.) Note that E(G 1 ) E(G f k ), since any edge in E(G f k+1 )\E(G f k ) must be the reverse of an edge in P k. Let H 1 simply consists of two copies of (t,s). Obviously G 1 + H 1 is Eulerian. Proposition 7.4. there are two edge disjoint s-t-paths Q 1 and Q 2. E(G 1 ) E(G f k ) both Q 1 and Q 2 are augmenting paths in G f k.
25
|E(P k )| ≤ | E(P k+1 )| for all k Since P k was a shortest f k - augmenting path, |E(P k )| ≤ |E(Q 1 )| and |E(P k )| ≤ |E(Q 2 )|. 2|E(P k )| ≤ |E(Q 1 )| + |E(Q 2 )| ≤ |E(G 1 )| ≤ ≤ |E(P k )| + |E(P k+1 )|. |E(P k )| ≤ |E(P k+1 )|.
26
|E(P k )| + 2 ≤ |E(P l )| for all k < l such that P k ⋃ P l contains a pair of reverse edges Let k < l such that for any i, k < i < l, P i P l contains no pair of reverse edges. Consider the graph G 1, which results from P k P l by deleting pairs of reverse edges. Again, E(G 1 ) E(G f k ): –E(P k ) E(G f k ), E(P l ) E(G f l ) –Any edge of E(G f l )\E(G f k ) must be the reverse of an edge in one of P k, P k+1,…, P l–1. –But − due to choice of k and l − among these paths only P k contains the reverse of an edge in P l. 2|E(P k )| ≤ |E(Q 1 )| + |E(Q 2 )| ≤ |E(G 1 )| ≤ ≤ |E(P k )| + |E(P k+1 )| – 2.
27
Lemma Lemma 7.5. Let f 1, f 2,... be a sequence of flows such that f i+1 results from f i by augmenting along P i, where P i is a shortest f i -augmenting path. Then a) |E(P k )| ≤ | E(P k+1 )| for all k. b) |E(P k )| + 2 ≤ |E(P l )| for all k < l such that P k ∪ P l contains a pair of reverse edges.
28
Number of Augmentations Theorem 7.6. (Edmonds, Karp [1972] ) Regardless of the edge capacities, the Edmonds-Karp Algorithm stops after at most mn/2 augmentations, where m is the number of edges and n is the number of vertices.
29
Proof Let P 1, P 2,… be the augmenting paths chosen during the Edmonds-Karp Algorithm. By the choice of γ in step 3 of the algorithm, each augmenting path contains at least one bottleneck edge e: u f (e) = γ. For any edge e, let P i 1, P i 2,… be the subsequence of augmenting paths containing e as a bottleneck edge. Then between P i j, P i j+1 there must be an augmenting path P к containing a reverse edge of e.
30
Proof Lemma 7.5 b) |E(P i j )| + 4 ≤ |E(P k )| + 2 ≤ |E(P i j+1 )| for all j. 1 ≤ |E(P i j )| ≤ n – 1 there can be at most n/4 augmenting paths containing e as a bottleneck edge. Since any augmenting path must contain at least one edge of Ğ as a bottleneck edge, there can be at most (n|E(Ğ)|)/4 =(mn)/2 augmenting paths.
31
Running time of Edmonds-Karp Algorithm Corollary 7.7. The Edmonds-Karp Algorithm solves the Maximum Flow Problem in O(m 2 n) time.
32
Applications: scheduling problem P. Given set of jobs J = {J 1,…, J n } and m parallel identical machines. A processing time p j, a release time r j, and a deadline d j are associated with each job J j. Find a feasible preemptive schedule or decide that none exists. Preemption of a job means that processing may be interrupted and resumed at a later time, even on another machine. So, a schedule is for each job an allocation of one or more intervals to one or more machines. Schedule is feasible if no two time intervals overlap on the same machine, no two time intervals allocated to the same job overlap, and each job J j is executed inside the interval [r j, d j ].
33
Exersice 7.1 Find a polynomial time algorithm for the scheduling problem P.
34
Solution J1J1 J1J1 JiJi JiJi JnJn JnJn I1I1 I1I1 IkIk IkIk IrIr IrIr p1p1 pipi pnpn mT r mT k mT 1 TkTk J i+1 p i+1 TkTk Let t 0 < t 1 < …< t r be the ordered sequence of all different r i -values and d i -values. Consider the intervals I k :=[t k– 1,t k ] of length T k = t k – t k– 1.
35
Homework Escape problem Given m ≤ n 2 starting points (x 1, y 1 ), (x 2, y 2 ),…, (x m,y m ) in the grid, the escape problem is to determine whether or not there are m vertex-disjoint paths from the starting points to any m different points on the boundary. Reduce the Escape problem to the Maximum Flow problem.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.