Download presentation
Presentation is loading. Please wait.
Published byBarbra McCoy Modified over 9 years ago
1
Graph Theory Chapter 6 Matchings and Factorizations 大葉大學 (Da-Yeh Univ.) 資訊工程系 (Dept. CSIE) 黃鈴玲 (Lingling Huang)
2
Copyright 黃鈴玲 Ch6-2 Outline 6.1 An Introduction to Matchings 6.2 Maximum Matchings in Bipartite Graphs 6.3 Maximum Matchings in General Graphs 6.4 Factorizations
3
Copyright 黃鈴玲 Ch6-3 6.1 An Introduction to Matchings Focus: Find 1-regular subgraphs of maximum size in a graph. Marriage Problem: Given a collection of men and women, where each woman knows some of the men, under what conditions can every woman marry a man she knows? A variation of this problem is to find the maximum number of woman, each of whom can marry a man she knows.
4
Copyright 黃鈴玲 Ch6-4 Model the problem: bipartite graph G = (S 1 S 2, E), S 1 ={men}, S 2 ={women}, ab E if a knows b. (1) Under what conditions does G have a 1-regular subgraph that contains all the vertices that represent the women? (2) What is the maximum size of a 1-regular subgraph of G ?
5
Copyright 黃鈴玲 Ch6-5 Optimal Assignment Problem: Given several job openings and applicants for one or more of these positions. The hiring company wishes to receive the maximum possible benefit as a result of its hiring. For example, the experience of the applicants may be an important factor to consider during the hiring process. The company may benefit by employing fewer people with more experience than a larger number with less experience.
6
Copyright 黃鈴玲 Ch6-6 Model the problem: weighted bipartite graph G = (S 1 S 2, E), S 1 ={applicants}, S 2 ={jobs}, a S 1, b S 2, ab E if a has applied b, w(a,b) is the benefit that the company will gain by hiring applicant a. To find a 1-regular subgraph H of G where the sum of the weights of the edges in H is a maximum.
7
Copyright 黃鈴玲 Ch6-7 Definition: A matching in a graph G is a 1-regular subgraph of G, that is, a subgraph induced by a collection of pairwise nonadjacent edges. We also refer to a matching as a collection of edges that induces a matching. A matching of maximum cardinality in a graph G is called a maximum matching of G.
8
Copyright 黃鈴玲 Ch6-8 c M = { ab, cd, ef } is a maximum matching M’ = { bc, de } is maximal, not maximum. a b d e f Maximum ( 所有 matching 中最多 edge 的 ) Maximal ( 此 matching 不可再加邊成為 更大的 matching)
9
Copyright 黃鈴玲 Ch6-9 Definition: If G is a graph of order p that has a matching of cardinality p /2, then such a matching is called a perfect matching. Note: If a graph of order p has a perfect matching, then p must be even. 反之未必成立 e.g. K 1,3 has even order but no perfect matching.
10
Copyright 黃鈴玲 Ch6-10 Definition: A matching in a weighted graph G is a set of edges of G, no two of which are adjacent. A maximum weight matching in a weighted graph is a matching in which the sum of the weights of its edges is maximum. Note: A maximum weight matching need not be a maximum matching.
11
Copyright 黃鈴玲 Ch6-11 M = { v 1 v 2, v 3 v 5 } is a maximum weight matching (weight sum=4) M’ = {v 1 v 2, v 3 v 4, v 5 v 6 } is a maximum matching v1v1 v2v2 v3v3 v5v5 v6v6 v4v4 2131 1
12
Copyright 黃鈴玲 Ch6-12 Definition: M : a matching of a graph G, e : an edge, v : a vertex (1). e M : e is called a matched edge (2). e M : e is an unmatched edge (3). v is a matched vertex if v is incident with a matched edge; v is a single vertex otherwise. (3). v is a matched vertex if v is incident with a matched edge; v is a single vertex otherwise. (4). An alternating path of G is a path whose edges are alternately matched and unmatched. (4). An alternating path of G is a path whose edges are alternately matched and unmatched. (5). An augmenting path of G is an alternating path that begins and ends with single vertices. (5). An augmenting path of G is an alternating path that begins and ends with single vertices.
13
Copyright 黃鈴玲 Ch6-13 An augmenting path P of G : P 中的邊將 M 的與 M 的性質交換, M 中的邊數會加一。 MMMM MMMM MMMM MMMM MMMM MMMM Single vertex
14
Copyright 黃鈴玲 Ch6-14 Thm 6.1 : M 1, M 2 : matchings of G E =( M 1 M 2 ) ∪ ( M 2 M 1 ), H is the spanning E =( M 1 M 2 ) ∪ ( M 2 M 1 ), H is the spanning subgraph of G with E ( H )= E, then every subgraph of G with E ( H )= E, then every component of H is one of the following type: component of H is one of the following type: (a) K 1 (a) K 1 (b) C 2n for some n (b) C 2n for some n (c) a path (alternating path) (c) a path (alternating path)
15
Copyright 黃鈴玲 Ch6-15 G : H : ( V ( H )= V ( G ) ) H 裡沒有 degree 3 的點 M1M2M1M2 Example:
16
Copyright 黃鈴玲 Ch6-16 Thm 6.2 A matching M in a graph G is a maximum matching if and only if there is no augmenting path, with respect to M, in G. matching if and only if there is no augmenting path, with respect to M, in G. Pf: ) trivial ) by Thm 6.1
17
Copyright 黃鈴玲 Ch6-17 Homework Exercise 6.1: 1
18
Copyright 黃鈴玲 Ch6-18 Outline 6.1 An Introduction to Matchings 6.2 Maximum Matchings in Bipartite Graphs 6.3 Maximum Matchings in General Graphs 6.4 Factorizations
19
Copyright 黃鈴玲 Ch6-19 6.2 Maximum Matchings in Bipartite Graphs Algorithm 6.1 (A maximum matching algorithm for bipartite graphs) [To determine a maximum matching in a bipartite graph G with V(G)={v 1, v 2, …, v p } and an initial matching M 1.] 1. i 1, M M 1 2. If i < p, then continue; otherwise, stop, M is a maximum matching now. 3. If v i is matched, then i i +1 and return to Step 2; otherwise, v v i and Q is initialized to contain v only. 4. 4.1 For j = 1, 2, …, p and j i, let Tree( v j )= F. ( 表示 v j 不在 alternating tree 中 ) Also, Tree( v i )= T.
20
Copyright 黃鈴玲 Ch6-20 4.2 If Q = , then i i +1 and return to step 2; otherwise, delete a vertex x from Q and continue. 4.2 If Q = , then i i +1 and return to step 2; otherwise, delete a vertex x from Q and continue. 4.3 4.3.1 Suppose that N(x)={y 1, y 2, …, y k }. Let j 1. 4.3.2 If j k, then y y j ; otherwise, return to Step 4.2. 4.3 4.3.1 Suppose that N(x)={y 1, y 2, …, y k }. Let j 1. 4.3.2 If j k, then y y j ; otherwise, return to Step 4.2. 4.3.3 If Tree( y )= T, then j j + 1 and return to Step 4.3.2; otherwise, continue. 4.3.4 If y is incident with a matched edge yz, then Tree( y ) T, Tree( z ) T, Parent( y ) x, Parent( z ) y and add z to Q, j j + 1, and return to Step 4.3.2. Otherwise, y is a single vertex ( 找到了 ! ) and we continue. 4.3.5 Use array Parent to determine the alternating v - x path P’ in the tree. Let P P’ U{ xy } be the augmenting path. 4.3.3 If Tree( y )= T, then j j + 1 and return to Step 4.3.2; otherwise, continue. 4.3.4 If y is incident with a matched edge yz, then Tree( y ) T, Tree( z ) T, Parent( y ) x, Parent( z ) y and add z to Q, j j + 1, and return to Step 4.3.2. Otherwise, y is a single vertex ( 找到了 ! ) and we continue. 4.3.5 Use array Parent to determine the alternating v - x path P’ in the tree. Let P P’ U{ xy } be the augmenting path. 5. Augment M along P to obtain a new matching M’. Let M M’, i i +1, and return to step 2.
21
Copyright 黃鈴玲 Ch6-21 Example (Fig 6.6) x1x1 x2x2 x3x3 x4x4 x5x5 x6x6 y1y1 y2y2 y3y3 y4y4 y5y5 y6y6 Initial matching M 1 i=1, x 1 is matched. i=2, v=x 2 Q : x2x2 x2x2 y2y2 x3x3 x5x5 y6y6 y1y1 x1x1 y4y4 x4x4 y3y3 x6x6 y5y5 x3x3 x5x5 x4x4 x1x1 x6x6 Augmenting path
22
Copyright 黃鈴玲 Ch6-22 Example (Fig 6.6) x1x1 x2x2 x3x3 x4x4 x5x5 x6x6 y1y1 y2y2 y3y3 y4y4 y5y5 y6y6 New matching M i=3, x 3 is matched. i=4, x 4 is matched. … i=12, y 6 is matched. M = { x 2 y 6, x 5 y 4, x 1 y 1, x 4 y 3, x 3 y 2, x 6 y 5 } is maximum.
23
Copyright 黃鈴玲 Ch6-23 Homework Exercise 6.2: 3
24
Copyright 黃鈴玲 Ch6-24 Outline 6.1 An Introduction to Matchings 6.2 Maximum Matchings in Bipartite Graphs 6.3 Maximum Matchings in General Graphs 6.4 Factorizations
25
Copyright 黃鈴玲 Ch6-25 6.3 Maximum Matchings in General Graphs For general graphs, the task of finding augmenting paths is complicated by the presence of odd cycles that have a maximum number of matched edges. For general graphs, the task of finding augmenting paths is complicated by the presence of odd cycles that have a maximum number of matched edges. 將 Alg 6.1 修改為 tree 中允許點重複, 但每點不可同時是自己的祖先
26
Copyright 黃鈴玲 Ch6-26 w v c a b u z y d v w Initial matching M 1 Example (Fig 6.9) x a c d d c b u y x w v v w x y z Augmenting path
27
Copyright 黃鈴玲 Ch6-27 2 4 5 6 11 8 3 7 9 Initial matching M 1 Example (Fig 6.10) 10 4 2 5 3 1 6 8 7 9 9 7 Augmenting path 1 8 6
28
Copyright 黃鈴玲 Ch6-28 Homework Exercise 6.3: 3 ( 先任給一個 matching)
29
Copyright 黃鈴玲 Ch6-29 Outline 6.1 An Introduction to Matchings 6.2 Maximum Matchings in Bipartite Graphs 6.3 Maximum Matchings in General Graphs 6.4 Factorizations
30
Copyright 黃鈴玲 Ch6-30 6.4 Factorizations Definition. A factor of a graph G is a spanning subgraph of G. (It is possible that a factor has no edges.) Suppose that G 1, G 2, …, G n are pairwise edge-disjoint spanning subgraphs of G such that U n i =1 E ( G i ) = E ( G ). Then G is factorable or factored into the subgraphs or factors G 1, G 2, …, G n, and we write G = G 1 G 2 … G n. This expression is also called a factorization of G into the factors G 1, G 2, …, G n.
31
Copyright 黃鈴玲 Ch6-31 Definition. An r -regular factor of a graph G is an r -factor of G. Thus, a graph has a 1-factor if and only if it contains a perfect matching. Definition. If there is a factorization of a graph G into r -factors, then G is said to be r -factorable. In this case, G is k -regular for some k that is a multiple of r.
32
Copyright 黃鈴玲 Ch6-32 H1H1 H H2H2 H3H3 A 1-factorization of K 3,3
33
Copyright 黃鈴玲 Ch6-33 H A 2-factorization of K 5 H1H1 H2H2
34
Copyright 黃鈴玲 Ch6-34 A 1-factorable cubic (3-regular)graph G H2H2 H3H3 H1H1
35
Copyright 黃鈴玲 Ch6-35 Theorem 6.10 Every regular bipartite multigraph of degree r 1 is 1-factorable. Proof. (by induction on r ) Theorem 6.11 For every positive integer n, the graph K 2n is 1-factorable. Proof. ( 參考下頁 K 6 的分解方法 )
36
Copyright 黃鈴玲 Ch6-36 A 1-factorization of K 6 H1H1 H2H2 H3H3 H4H4 H5H5 中心點 v 每次先連一點 x ,再將剩下的點配對, 產生的邊需垂直於 vx
37
Copyright 黃鈴玲 Ch6-37 Definition A spanning cycle in a graph G is called a Hamiltonian cycle. Proof. ( 參考下頁 K 7 的分解方法 ) Theorem 6.12 For every positive integer n, the graph K 2n+1 is can be factored into n Hamiltonian cycles.
38
Copyright 黃鈴玲 Ch6-38 3 Hamiltonian cycles of K 7 F1F1 v0v0 v1v1 v2v2 v3v3 v4v4 v5v5 v6v6 F2F2 v0v0 v1v1 v2v2 v3v3 v4v4 v5v5 v6v6 F3F3 v0v0 v1v1 v2v2 v3v3 v 4 v5v5 v6v6
39
Copyright 黃鈴玲 Ch6-39 Petersen Graph ( 在圖論的一些性質中常扮演反例的角色 ) Petersen graph is not 1-factorable. ( 證明略過 )
40
Copyright 黃鈴玲 Ch6-40 Homework Exercise 6.4: 3, 4 ( 參考 Fig 6.14) C 4 K 2 : Ex 3. Show that C n K 2 is 1-factoriable for every n 4.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.