Download presentation
Presentation is loading. Please wait.
Published byBarnard Gray Modified over 9 years ago
1
Graph Theory Chapter 5 Networks 大葉大學 (Da-Yeh Univ.) 資訊工程系 (Dept. CSIE) 黃鈴玲 (Lingling Huang)
2
Copyright 黃鈴玲 Ch5-2 Outline 5.1 An Introduction to Networks 5.2 The Max-Flow Min-Cut Theorem 5.3 A Max-Flow Min-Cut Algorithm 5.5 Connectivity and Edge-Connectivity 5.6 Menger ’ s Theorem
3
Copyright 黃鈴玲 Ch5-3 5.1 An Introduction to Networks ※ Motivation: Suppose that a World Series baseball game is to be played in city B. Since the team from city A is playing in this game, many fans from A wish to fly to B on short notice. Several flight routes exist from A to B. The maximum number of seats available on every such flight is known. We wish to determine the maximum number of fans that can be flown from A to B and the routes they should take. How can this be done?
4
Copyright 黃鈴玲 Ch5-4 Definition: A network N is a digraph D with two distinguished vertices s and t, called the source and sink, respectively, and a nonnegative integer-valued function c on E(D), called the capacity function of N. The function c takes on nonnegative integers and . The digraph D is called the underlying digraph of N. If a = (u, v) is an arc of D, then c(a) = c(u, v) is called the capacity of a.
5
Copyright 黃鈴玲 Ch5-5 s z y x t 1 3 5 2 4 1 A network N : source sink c(x, y)=4, c(t, z)=5
6
Copyright 黃鈴玲 Ch5-6 Definition: For a vertex x in a digraph D, the out-neighborhood and in- neighborhood of x are defined by N + (x) = { y V(D) | (x, y) E(D) } and N (x) = { y V(D) | (y, x) E(D) }, respectively. s z y x t 1 3 5 2 4 1 N + (x) = { y, z } N (x) = { s }
7
Copyright 黃鈴玲 Ch5-7 Definition: A flow in N is an integer-valued function f on E(D) such that 0 f(a) c(a) for every a E(D) and The net flow out of a vertex x is defined as While the net flow into x is (5.2) (5.1)
8
Copyright 黃鈴玲 Ch5-8 Definition: For an arc a = (x, y) of N, the value f(a) = f(x, y) is called the flow in or along arc a, and may be thought of as the amount of material that is transported under the flow f along the arc (x, y). Note. Condition (5.2) is referred to as the Equation (5.1) says that flow in an arc can never exceed its capacity and is called the capacity constraint. Condition (5.2) is referred to as the conservation equation. ( 出 = 進 )
9
Copyright 黃鈴玲 Ch5-9 Definition: The value f(N) of the flow f in N is the net flow out of the source s that is, The value f(N) of the flow f in N is the net flow out of the source s that is,
10
Copyright 黃鈴玲 Ch5-10 N: tS vu y w xz 3,3 5,3 1,1 6,2 4,2 3,2 4,1 4,4 3,1 Figure 5-2 The numbers on an arc : capacity, flow f ( N ) = 4 f (s, x) = 3, c(s, x)=5
11
Copyright 黃鈴玲 Ch5-11 Definition: Suppose is the capacity of the cut. Further, if is a flow in, then the flow from P to is (P, ) and the flow from to P is Suppose c is the capacity of the cut. Further, if f is a flow in N, then the flow from P to is f (P, ) and the flow from to P is f (, P). Definition: Let X, Y V(D), (X,Y) = {(x, y) E(D) | x X, y Y }. A cut in is a set of arcs of the type ( P, ) A cut in N is a set of arcs of the type ( P, ) in, where containing but not and where in D, where P V(D), containing s but not t and where = V(D) P. ( 有時需考慮由一群點 X 流進另一群點 Y 的 flow 量 )
12
Copyright 黃鈴玲 Ch5-12 N: tS vu y w xz 3,3 5,3 1,1 6,2 4,2 3,2 4,1 4,4 3,1 Figure 5-2 eg: If P = {s, x} then {(x,y), (s,u)} is a cut. c(P, )=16, f(P, )=9 If P = {s, y, w} then {(s,x), (s,u), (y,u), (y,z), (w,v)} is a cut.
13
Copyright 黃鈴玲 Ch5-13 Thm 5.1 Let be a network and a flow in. If is a cut of, then the value of the flow in is given by Let N be a network and f a flow in N. If (P, ) is a cut of N, then the value of the flow in N is given by pf: By definition,
14
Copyright 黃鈴玲 Ch5-14 which is the net flow out of source. If then it follows from equation (5.2) that the net flow out of the vertex is given by which is the net flow out of source s. If x P – {s}, then it follows from equation (5.2) that the net flow out of the vertex x is given by Hence, if we sum the net flow out of a vertex over all vertices of (including ), we obtain Hence, if we sum the net flow out of a vertex x over all vertices x of P (including s ), we obtain
15
Copyright 黃鈴玲 Ch5-15 Now and since Since both and sum the flow in all arcs that have both end- vertices in P, these two quantities are equal. Hence, we obtain Since both and sum the flow in all arcs that have both end- vertices in P, these two quantities are equal. Hence, we obtain #
16
Copyright 黃鈴玲 Ch5-16 Corollary 5.1a Let be a network and f a flow in. Then the value of the flow in cannot exceed the capacity of any cut in, that is, Let N be a network and f a flow in N. Then the value of the flow in N cannot exceed the capacity of any cut (P, ) in N, that is, f(N) min {c(P, )}, Where the minimum is taken over all cuts in Where the minimum is taken over all cuts (P, ) in N.
17
Copyright 黃鈴玲 Ch5-17 Corollary 5.1b Let be a network and a flow in. Then the value of the flow in equals the flow into the sink of, that is, Let N be a network and f a flow in N. Then the value of the flow in N equals the flow into the sink t of N, that is, pf: Let D be the underlying digraph of N, and let P = V(D) – {t}; so ={t}. Then, (x, y) ( P, ) iff y = t and x N - (t). Moreover, (y, x) (,P) iff y = t and x N + (t). Hence, the result follows.
18
Copyright 黃鈴玲 Ch5-18 Homework N: tS yx v w u 2 3 3 1 4 4 5 3 1 2 1. Let N be the network shown below, where each arc is labeled with its capacity. A function f is defined on the arcs of N as follows: f (s, u) = 3, f (u, v) = 3, f (v, t) = 4, f (s, x) = 4, f (x, y) = 3, f (y, t) = 1, f (x, v) = 1, f (w, s) = 0, f (y, w) = 2, f (w, t) = 2 Is f a flow in N ? Explain.
19
Copyright 黃鈴玲 Ch5-19 Homework 2. For the network shown below, each arc has unlimited capacity. A flow in the network is indicated by the labels on the arcs. Determine the missing flows a, b, c. t S x x v z u 1 1 3 2 a 6 1 4 c 3 2 y 7 b 2’: Let P = {s, u, w, y}. What is f (P, P ) ?
20
Copyright 黃鈴玲 Ch5-20 Outline 5.1 An Introduction to Networks 5.2 The Max-Flow Min-Cut Theorem 5.3 A Max-Flow Min-Cut Algorithm 5.5 Connectivity and Edge-Connectivity 5.6 Menger ’ s Theorem
21
Copyright 黃鈴玲 Ch5-21 5.2 The Max-Flow Min-Cut Theorem Definition: A flow f in a network N is called a maximum flow if f ( N ) f ’ ( N ) for every flow f ’ in N. A cut ( P, ) is a minimum cut of N if c ( P, ) c ( X, ) for every cut ( X, ) of N. Note. A maximum flow and a minimum cut exist.
22
Copyright 黃鈴玲 Ch5-22 Definition: A u 0 – u n semipath: Q: u 0, a 1, u 1, a 2, u 2, …, u n 1, a n,u n 去掉邊的方向性時, 看起來是 path. u3u3 u0u0 u1u1 u n -1 u2u2 unun a2a2 a1a1
23
Copyright 黃鈴玲 Ch5-23 Definition: A semipath u 0, a 1, u 1, a 2, u 2, …, u n-1, a n,u n in D is said to be f -unsaturated if i, 1 i n. either (a). a i = (u i-1, u i ), f(a i ) < c(a i ) or (b). a i = (u i, u i-1 ), f(a i ) > 0 (a). u i -1 ui ui ui ui (b). 且 f < c 方向性一致, 還有剩下的位置 f 可再上昇 aiai aiai 方向相反, 至少載了一個人 f 可再下降. NOTE: An f-unsaturated s-t semipath is called on f-augmenting path
24
Copyright 黃鈴玲 Ch5-24 Thm 5.2: : network with underlying digraph. A flow in is maximum iff there is no f -augmenting semipath in. N : network with underlying digraph D. A flow f in N is maximum iff there is no f -augmenting semipath in D. Let i = c(a i ) f(a i ) if a i satisfies condition (a). e.g., u3u3 u0u0 u1u1 u2u2 u4u4 1,1 4,2 3,2 6,2 If there is a f -augmenting semipath: Let i = f(a i ) if a i satisfies condition (b). Let = min { i | i }. 1 =2, 2 =1, 3 =1, 4 =4 4,3 1,0 3,3 6,3 =1
25
Copyright 黃鈴玲 Ch5-25 ts y x 2 3 1 1 2 2 3 3 0 e.g. c(a)=3 arc a ts y x 2 3 0 1 2 3 3 3 1 f(N)=5 f(N)=6 f -augmenting semipath <3>0<3 =1
26
Copyright 黃鈴玲 Homework Homework 3. For the following network and flow f, find a f -augmenting semipath. Ch5-26 N: tS vu y w xz 3,3 5,3 1,1 6,2 4,2 3,2 4,1 4,4 3,1
27
Copyright 黃鈴玲 Ch5-27 Outline 5.1 An Introduction to Networks 5.2 The Max-Flow Min-Cut Theorem 5.3 A Max-Flow Min-Cut Algorithm 5.5 Connectivity and Edge-Connectivity 5.6 Menger ’ s Theorem
28
Copyright 黃鈴玲 Ch5-28 5.3 A Max-Flow Min-Cut Algorithm Thm 5.4: N : network D : digraph c : capacity f: flow Let D’ be a digraph with V(D’) = V(D). E(D’) = {(x, y) | (x, y) E(D) and c(x, y) > f(x, y) or (y, x) E(D), and f(y, x)> 0} Then D’ has a s-t path iff D has an f -augmenting semipath.( 課本 P. 143)
29
Copyright 黃鈴玲 Ch5-29 s y x u v w Algorithm 5.1 (Max-Flow Min-Cut Algorithm) t 3,1 2,1 3,2 1,1 4,43,31,1 3,15,1 Initial flow 可假設為 f ( a )=0 a, 此處假設已做了部份 Stage 1 : find D ’ 2,2 s y x u v w t Stage 1 ’ : Find shortest s-t path s, (w, s), w, (w, t), t =1 3,1
30
Copyright 黃鈴玲 Ch5-30 Algorithm 5.1 (Max-Flow Min-Cut Algorithm) Stage 3 : find D ’ again s y x u v w t Stage 3 ’ : Find shortest s-t path s, (s, u), u, (u,v), v, (v, t), t =1 s y x u v w t 3,1 2,1 3,2 1,1 4,43,31,1 3,05,2 2,2 Stage 2 : 改變 path 中的 flow 值 f(a)= f(a) – 若 a 為反向 f(a)= f(a) + 若 a 為同向
31
Copyright 黃鈴玲 Ch5-31 Algorithm 5.1 (Max-Flow Min-Cut Algorithm) Stage 5 : find D ’ again s y x u v w t Stage 5 ’ : Find shortest s-t path No s y x u v w t 3,2 2,2 3,3 1,1 4,43,31,1 3,05,2 2,2 Stage 4 : 改變 path 中的 flow 值 f(a)= f(a) – 若 a 為反向 f(a)= f(a) + 若 a 為同向 令 P 為 s 在 D ’ 中可以走到的點的集合 f(N) = 6
32
Copyright 黃鈴玲 Ch5-32 ( P, ) is a minimum cut, c ( P, )=6 P={ s, u }={ x, v, w, y, t } s y x u v w t 3,2 2,2 3,3 1,1 4,43,31,1 3,05,2 2,2
33
Copyright 黃鈴玲 Ch5-33 Homework 4. Shown below is a network N and a flow f 1, each arc is labeled with its capacity and the flow along the arc. (a) What if the value of f 1 ? (b) Construct the corresponding digraph D ’. (c) Use the digraph D ’ to find an f 1 -augmenting semipath in N. (d) Find a maximum flow f and a minimum cut for N. s y x uv t 3,1 2,2 4,3 1,1 5,3 5,4 2,2 1,1 w
34
Copyright 黃鈴玲 Ch5-34 Homework 5. Use Algorithm 5.1 to find a maximum flow and a minimum cut for the network shown below. (Assume f ( a )=0 for each arc a. ) 5. Use Algorithm 5.1 to find a maximum flow and a minimum cut for the network shown below. (Assume f ( a )=0 for each arc a. ) s y x u v t 3 4 5 2 4 2 16 2 1 1 3 w z
35
Copyright 黃鈴玲 Ch5-35 Outline 5.1 An Introduction to Networks 5.2 The Max-Flow Min-Cut Theorem 5.3 A Max-Flow Min-Cut Algorithm 5.5 Connectivity and Edge-Connectivity 5.6 Menger ’ s Theorem
36
Copyright 黃鈴玲 Ch5-36 5.5 Connectivity and Edge-Connectivity Definition: G: connected graph 1. U E(G) is an edge cutset of G if G U is disconnected. 2. S V(G) is a vertex cutset of G if G S is disconnected.
37
Copyright 黃鈴玲 Ch5-37 Figure 5.7 v5v5 v1v1 v6v6 v3v3 v4v4 v2v2 G S={ v 1, v 2, v 3 }U={ v 1 v 5, v 2 v 5, v 2 v 6, v 3 v 6 } GUGU v5v5 v1v1 v6v6 v3v3 v4v4 v2v2 v1v1 v3v3 v2v2 v5v5 v6v6 v4v4 GSGS {v 1 v 4, v 1 v 5 } is an edge cutset smaller than U. {v 4, v 5 } is a vertex cutset smaller than S.
38
Copyright 黃鈴玲 Ch5-38 Definition: G : graph, The edge connectivity of G λ(G) = min {| U |: U E(G), G U is disconnected or trivial (G K 1 ) } ( λ(G) = 0 G is disconnected or trivial) The (vertex) connectivity (G) = min{ |S|: S V(G), G S is disconnected or trivial } Consider trivial graph : K1K1 λ( G ) = 0 ( G ) = 0
39
Copyright 黃鈴玲 Ch5-39 Consider complete graphs : KpKp λ( K p ) = p -1 ( K p ) = p -1 If a graph G is not complete, then ( G ) is the minimum cardinality of a vertex cutset of G. Moreover, a graph G has ( G ) = 0 if and only if G is disconnected or trivial.
40
Copyright 黃鈴玲 Ch5-40 Thm 5.5: For every graph G, For every graph G, λ(G) δ(G) ( G ) λ(G) δ(G) λ(G) δ(G) ) pf: (λ(G) δ(G) ) GvGv edge cutset v δ( G ). Choose a vertex v with deg( v ) = δ( G ). λ(G) δ(G)λ(G) δ(G)λ(G) δ(G)λ(G) δ(G)
41
Copyright 黃鈴玲 Ch5-41 ( λ ( G ) ) ( ( G ) λ ( G ) ) 1. If λ(G) = 0 then G is disconnected or trivial = 0 then G is disconnected or trivial ( G ) = 0 2. If λ(G) = 1 then G has a bridge = 1 2. If λ(G) = 1 then G has a bridge ( G ) = 1 3. If λ(G) 2 Let U be an edge cutset with | U | = λ(G), then G U has two components. Let U be an edge cutset with | U | = λ(G), then G U has two components. | U | Since | S | | U | ∴ λ (G) ∴ ( G ) λ (G) G U has at least 3 components, then there exists a smaller edge cutset. Note: If G U has at least 3 components, then there exists a smaller edge cutset. G1 G1 U vertex cutset S Let G 1 be a nontrivial component of G U.
42
Copyright 黃鈴玲 Ch5-42 Definition: λ(G) A graph G is n -edge-connected ( n 1 ) if λ(G) n (delete n-1 edges 此圖仍會 connected) (G) A graph G is n -connected if (G) n (delete n-1 點 此圖仍會 connected or nontrivial)
43
Copyright 黃鈴玲 Ch5-43 Thm 5.7: Let G be a graph of order p, let n , 1 n p-1. If δ(G) (p+n-2)/2, then G is n -connected ( (G) n ) pf: ( 反證 ) (1) If G K p, (G) = p-1 ∵ 1 n p-1 ∴ (G) n ∴ G is n- connected
44
Copyright 黃鈴玲 Ch5-44 (2) If G K p and assume to the contrary that G is not n -connected. Then S V(G) be a cutset and |S| = k < n Let G 1 be a component of minimum order in G - S. ∵ |V(G - S)| = p – k ∴ |V(G 1 )| (p - k)/2 If v V ( G 1 ) then, deg(v) ((p - k)/2 – 1) + k = ( p + k- 2)/2 < ( p + n -2 )/2
45
Copyright 黃鈴玲 Ch5-45 Homework Exercise 5.5: 1, 2, 3, 4, 5, 6 Exercise 5.5: 1, 2, 3, 4, 5, 6
46
Copyright 黃鈴玲 Ch5-46 Outline 5.1 An Introduction to Networks 5.2 The Max-Flow Min-Cut Theorem 5.3 A Max-Flow Min-Cut Algorithm 5.5 Connectivity and Edge-Connectivity 5.6 Menger ’ s Theorem
47
Copyright 黃鈴玲 Ch5-47 5.6 Menger ’ s Theorem Definition: A set S of edges (vertices) of a graph G is said to separate two vertices u and v of G if G S is a disconnected graph in which u and v lie in different components. i.e., S separates u and v if G S contains no u - v path.
48
Copyright 黃鈴玲 Ch5-48 Definition: u, v V(G), Q 1 : u - v path, Q 2 : u - v path Q 1, Q 2 are edge-disjoint if E ( Q 1 ) E ( Q 2 ) = , Q 1, Q 2 are internally disjoint if V ( Q 1 ) V ( Q 2 ) = { u, v }
49
Copyright 黃鈴玲 Ch5-49 Definition: u v V(G), (u, v) = min number of edges that separate u and v (u, v) = min number of vertices that separate u and v if uv E(G), | V(G) | 1 if uv E(G) M(u, v) = max number of internally disjoint u - v paths. M’(u, v) = max number of edge-disjoint u - v paths.
50
Copyright 黃鈴玲 Ch5-50 Thm 5.8 ( 考慮 edge) λ (, ) = λ ( u, v ) = M’(u, v ) u, v V(G) Thm 5.9 ( 考慮 vertex) (Menger Theorem) (, ) = ( u, v ) = M(u, v) u, v V(G) with uv E(G) ( 要 separate 兩點,最少需 delete 的點數 = 它們間 internally disjoint path 的最大個數 ) ( 要 separate 兩點,最少需 delete 的邊數 = 它們間 edge-disjoint path 的最大個數 )
51
Copyright 黃鈴玲 Ch5-51 Homework Exercise 5.6: 2, 3 Exercise 5.6: 2, 3 Ex2. Let G be an n -connected graph of order p. Show that p n (diam( G ) 1) + 2. Ex3. Let G be an n -edge-connected graph of size q. Show that q n diam( G ).
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.