520 likes | 747 Views
Graph Theory Chapter 5 Networks. 大葉大學 (Da-Yeh Univ.) 資訊工程系 (Dept. CSIE) 黃鈴玲 (Lingling Huang). 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.
E N D
Graph TheoryChapter 5 Networks 大葉大學(Da-Yeh Univ.)資訊工程系(Dept. CSIE)黃鈴玲(Lingling Huang)
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
5.1 An Introduction to Networks ※ Motivation: Suppose that a World Series baseball gameis to be played in city B. Since the team from city A is playing in this game, many fans from Awish to fly to B on short notice. Several flight routes exist from A to B. The maximum numberof seats available on every such flight is known.We wish to determine the maximum number offans that can be flown from A to B and the routesthey should take. How can this be done?
Definition: A networkN 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 ofD, then c(a) = c(u, v) is called the capacity ofa.
x z 1 3 5 t s 4 1 2 y A network N : sink source c(x, y)=4, c(t, z)=5
x z 1 3 5 t s 4 1 2 y 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) }andN-(x)={ y V(D) | (y, x) E(D) } , respectively. N+(x)= { y, z } N-(x)= { s }
(5.1) Definition: A flow inNis an integer-valuedfunctionfonE(D)such that 0 f(a) c(a)for everya E(D)and The net flow out of a vertex x is defined as While the net flow into x is (5.2)
Definition: Foran arca = (x, y)ofN, the valuef(a) = f(x, y)is called the flow in or along arca, and may be thought of as the amount of material that is transported under the flowfalong the arc(x, y). Note. 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. (出=進)
Definition: The value f(N) of the flowf in N is the net flow out of the source s that is,
x y z 3,3 3,2 N: 6,2 1,1 5,3 4,2 5,3 4,4 S t u v 3,1 4,1 3,2 w Figure 5-2 The numbers on an arc: capacity, flow f(N) = 4 f (s, x) = 3, c(s, x)=5
(有時需考慮由一群點X流進另一群點Y的flow量) Definition: Let X, Y V(D),(X,Y) = {(x, y) E(D) | x X, y Y }. A cut in N is a set of arcs of the type (P, ) in D, where P V(D),containing s but not t and where = V(D) - P. Definition: Supposec 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).
c(P, )=16, f(P, )=9 Figure 5-2 x y z 3,3 3,2 N: 6,2 1,1 5,3 4,2 5,3 4,4 S t u v 3,1 4,1 3,2 w eg:If P = {s, x} then{(x,y), (s,u)} is a cut. If P = {s, y, w} then{(s,x), (s,u), (y,u), (y,z), (w,v)} is a cut.
Thm 5.1 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,
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 x over all vertices x of P (including s), we obtain
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 #
Corollary 5.1a 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 (P, ) in N.
Corollary 5.1b 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.
u v 2 N: 4 3 1 4 3 1 S t x y 2 3 5 w Homework 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.
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. v u 1 6 1 2 7 x 3 c a S t x 3 b 4 1 2 z y 2’: Let P ={s, u, w, y}. What is f (P, P )?
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
5.2 The Max-Flow Min-Cut Theorem Definition: A flow f in a network N is called a maximum flow iff (N) f ’(N) for every flow f ’ in N.A cut (P, ) is a minimum cut of Nif c(P, ) c(X, ) for every cut (X, ) of N. Note. A maximum flow and a minimum cut exist.
a1 a2 u0 u1 u2 u3 un-1 un Definition: Au0–unsemipath: Q:u0 , a1 , u1 , a2 , u2 , …, un-1 , an ,un去掉邊的方向性時,看起來是path.
Definition: A semipath u0, a1, u1, a2, u2, …, un-1, an ,un in D is said to bef-unsaturated if i, 1 i n. either (a). ai = (ui-1, ui), f(ai) < c(ai) or (b). ai = (ui, ui-1), f(ai) > 0 ai 且 f< c方向性一致, 還有剩下的位置 f可再上昇 (a). ui-1 ui ai 方向相反, 至少載了一個人f可再下降. (b). ui-1 ui NOTE: An f-unsaturated s-t semipath is called on f-augmenting path
4,2 3,2 6,2 1,1 1,0 3,3 6,3 4,3 u0 u1 u2 u3 u4 Thm 5.2: N: network with underlying digraph D. A flow f in N is maximum iff there is no f-augmenting semipath in D. e.g., If there is a f-augmenting semipath: D1 =2, D2 =1,D3 =1, D4 =4 D=1 Let Di = c(ai) - f(ai) ifaisatisfies condition (a). Let Di = f(ai) ifaisatisfies condition (b). Let D= min{Di |i }.
<3 >0 <3 2 2 1 3 x s t 3 0 y 1 3 3 e.g. c(a)=3 arca f-augmenting semipath 2 2 1 3 x f(N)=5 s t 2 1 y 0 D=1 3 3 f(N)=6
x y z 3,3 3,2 N: 6,2 1,1 5,3 4,2 5,3 4,4 S t u v 3,1 4,1 3,2 w Homework3. For the following network and flow f,find a f-augmenting semipath.
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
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} ThenD’has as-tpathiffDhas anf-augmenting semipath.(課本P. 143)
v u s t x y w Algorithm 5.1 (Max-Flow Min-Cut Algorithm) Initial flow 可假設為f(a)=0 a, 此處假設已做了部份 Stage 1 : find D’ 2,1 v u 3,2 3,1 1,1 y 4,4 3,3 1,1 s x t 2,2 3,1 3,1 5,1 w Stage 1’ : Find shortest s-t path s, (w, s), w, (w, t), t D=1
Stage 2 : 改變path中的flow值 f(a)= f(a) – D 若 a為反向f(a)= f(a) +D 若 a為同向 v u 2,1 v s u t x y 3,2 3,1 1,1 y 4,4 3,3 1,1 t s w x 2,2 3,0 5,2 w Algorithm 5.1 (Max-Flow Min-Cut Algorithm) Stage 3 : find D’ again Stage 3’ : Find shortest s-t path s, (s, u), u, (u,v), v, (v, t), t D=1
Stage 4 : 改變path中的flow值 f(a)= f(a) – D 若 a為反向f(a)= f(a) +D 若 a為同向 v u 2,2 v s u t x y 3,3 3,2 1,1 y 4,4 3,3 1,1 t s w x 2,2 3,0 5,2 w Algorithm 5.1 (Max-Flow Min-Cut Algorithm) Stage 5 : find D’ again Stage 5’ : Find shortest s-t path f(N) = 6 No 令 P為 s 在 D’中可以走到的點的集合
P={s, u} ={x, v, w, y, t} 2,2 v u 3,3 3,2 1,1 y 4,4 3,3 1,1 t s x 2,2 3,0 5,2 w (P, ) is a minimum cut, c(P, )=6
Homework 4. Shown below is a network N and a flow f1, each arc is labeled with its capacity and the flow along the arc. (a) What if the value of f1? (b) Construct the corresponding digraph D’.(c) Use the digraph D’ to find an f1-augmenting semipath in N.(d) Find a maximum flow f and a minimum cut for N. 2,2 u v 3,1 4,3 2,2 w x 1,1 2,2 1,1 t s 1,1 5,3 5,4 y
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.) 4 u v 3 2 w 5 t 4 s 1 1 2 3 1 z 6 2 x y
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
5.5 Connectivity and Edge-Connectivity Definition: G:connected graph 1.U E(G)is anedge cutset ofGif G-Uis disconnected. 2.S V(G)is avertex cutsetofGif G-Sis disconnected.
v5 G v1 v2 v6 v3 v4 G-U v5 v5 v1 v2 v6 v1 v2 v6 v3 v4 v3 v4 Figure 5.7 U={ v1v5, v2v5, v2v6, v3v6 } S={ v1, v2, v3 } G-S {v1v4, v1v5} isan edge cutset smaller than U.{v4, v5} isa vertex cutset smaller than S.
Definition: G:graph, Theedge connectivity ofG λ(G)= min {|U|:UE(G),G-Uis disconnected or trivial(G K1) } (λ(G)= 0Gis disconnected or trivial) The (vertex) connectivity k(G) = min{|S|: S V(G) , G-S is disconnected or trivial } Consider trivial graph: λ(G) = 0 k(G)= 0 K1
Consider complete graphs: λ(Kp) = p-1 k(Kp)= p-1 Kp If a graph G is not complete, then k(G) is the minimum cardinality of a vertexcutset of G.Moreover, a graph G has k(G) = 0 if and onlyif G is disconnected or trivial.
v G-v edge cutset Thm 5.5: For every graph G, k(G) λ(G) δ(G) pf:(λ(G) δ(G) ) Choose a vertex v with deg(v) = δ(G). λ(G) δ(G)
U G1 vertex cutset S (k(G) λ(G)) 1. If λ(G)= 0 thenGis disconnected or trivial k(G) = 0 2. Ifλ(G)= 1thenGhas a bridge k(G) = 1 3. Ifλ(G) 2 LetUbe an edge cutset with |U| = λ(G),then G -U has two components. Note: If G -Uhas at least 3 components, then there exists a smaller edge cutset. Let G1 be a nontrivial component of G-U. Since |S| |U| ∴ k(G) λ(G)
Definition: A graph G is n-edge-connected(n1) if λ(G) n(delete n-1 edges 此圖仍會connected) A graph G is n-connected if k(G) n(delete n-1點 此圖仍會connected or nontrivial)
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(k(G) n) pf: (反證) (1) IfG Kp , k(G) = p-1 ∵ 1 n p-1 ∴ k(G) n ∴ G is n-connected
(2) IfGKpand assume to the contrarythatGis notn-connected. Then SV(G)be a cutset and|S| = k < n Let G1 be a component of minimum order in G - S. ∵ |V(G - S)| = p – k ∴|V(G1)| (p - k)/2 If vV(G1) then, deg(v) ((p - k)/2 – 1) + k = ( p + k- 2)/2 < ( p + n -2 )/2
Homework • Exercise 5.5:1, 2, 3, 4, 5, 6
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
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.
Definition: u, v V(G), Q1 : u - v path, Q2: u - v pathQ1, Q2 are edge-disjoint if E(Q1) E(Q2) = , Q1, Q2 are internally disjoint if V (Q1) V(Q2) = { u, v }
Definition: u v V(G), l(u, v) = min number of edges that separate u and v k(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 disjointu - vpaths. M’(u, v) = max number of edge-disjoint u - v paths.
Thm 5.8(考慮edge) λ(u, v) = M’(u, v) u,v V(G) (要separate兩點,最少需delete的邊數= 它們間edge-disjoint path的最大個數) Thm 5.9(考慮vertex) (Menger Theorem) k(u, v) = M(u, v) u,v V(G)withuv E(G) (要separate兩點,最少需delete的點數= 它們間internally disjoint path的最大個數)