Graph Theory Chapter 6 Matchings and Factorizations 大葉大學 (Da-Yeh Univ.) 資訊工程系 (Dept. CSIE) 黃鈴玲 (Lingling Huang)

Slides:



Advertisements
Similar presentations
Algorithms Chapter 15 Dynamic Programming - Rod
Advertisements

Colorings of graphs and Ramsey’s theorem
A Better Algorithm for Finding Planar Subgraph Gruia Călinescu Cristina G. Fernandes Ulrich Finkler Howard Karloff.
Chapter 3 Determinants and Eigenvectors 大葉大學 資訊工程系 黃鈴玲 Linear Algebra.
Graph Theory Chapter 9 Planar Graphs 大葉大學 資訊工程系 黃鈴玲.
Chapter 10 馬可夫鏈 緒言 如果讀者仔細觀察日常生活中所發生的 諸多事件,必然會發現有些事件的未來 發展或演變與該事件現階段的狀況全然 無關,這種事件稱為獨立試行過程 (process of independent trials) ;而另一些 事件則會受到該事件現階段的狀況影響。
1 Q10276: Hanoi Tower Troubles Again! 星級 : ★★★ 題組: Online-judge.uva.es PROBLEM SET Volume CII 題號: Q10276: Hanoi Tower Troubles Again! 解題者:薛祖淵 解題日期: 2006.
交易的動機. 討論:  為什麼人要進行交易? 討論:  試想像你走進一間唱片店,付了$100 給店主,買下你最喜愛歌手的最新唱片。  誰會得益 ?  誰又會有所損失?
1.1 線性方程式系統簡介 1.2 高斯消去法與高斯-喬登消去法 1.3 線性方程式系統的應用(-Skip-)
Graph V(G 1 )={0, 1, 2, 3, 4, 5, 6, 7, 8, 9} E(G 1 )={(0, 2), (0, 3), (1, 4), (2, 3), (2, 5), (2, 6), (3, 6), (3, 7), (4, 7), (5, 6), (5,
: ShellSort ★★☆☆☆ 題組: Problem D 題號: 10152: ShellSort 解題者:林一帆 解題日期: 2006 年 4 月 10 日 題意:烏龜王國的烏龜總是一隻一隻疊在一起。唯一改變烏龜位置 的方法為:一隻烏龜爬出他原來的位置,然後往上爬到最上方。給 你一堆烏龜原來排列的順序,以及我們想要的烏龜的排列順序,你.
STAT0_sampling Random Sampling  母體: Finite population & Infinity population  由一大小為 N 的有限母體中抽出一樣本數為 n 的樣 本,若每一樣本被抽出的機率是一樣的,這樣本稱 為隨機樣本 (random sample)
: The Playboy Chimp ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10611: The Playboy Chimp 解題者:蔡昇宇 解題日期: 2010 年 2 月 28 日 題意:給一已排序的數列 S( 升冪.
Monte Carlo Simulation Part.2 Metropolis Algorithm Dept. Phys. Tunghai Univ. Numerical Methods C. T. Shih.
2009fallStat_samplec.i.1 Chap10 Sampling distribution (review) 樣本必須是隨機樣本 (random sample) ,才能代表母體 Sample mean 是一隨機變數,隨著每一次抽出來的 樣本值不同,它的值也不同,但會有規律性 為了要知道估計的精確性,必需要知道樣本平均數.
Network Connections ★★★☆☆ 題組: Contest Archive with Online Judge 題號: Network Connections 解題者:蔡宗翰 解題日期: 2008 年 10 月 20 日 題意:給你電腦之間互相連線的狀況後,題.
: Abundance and Perfect Numbers ★★★★☆ 題組: Contest Volumes with Online Judge 題號: 10914: Abundance and Perfect Numbers 解題者:劉洙愷 解題日期: 2008 年 5 月 2.
: The largest Clique ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11324: The largest Clique 解題者:李重儀 解題日期: 2008 年 11 月 24 日 題意: 簡單來說,給你一個 directed.
Fourier Series. Jean Baptiste Joseph Fourier (French)(1763~1830)
各種線上電子資源的特異功能 SpringerLINK 的 Alert, Serials Update, News 2003/4/28 修改.
Johnson’s algorithm Johnson’s演算法可用於計算All pairs shortest path問題。
: Count DePrimes ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11408: Count DePrimes 解題者:李育賢 解題日期: 2008 年 9 月 2 日 題意: 題目會給你二個數字 a,b( 2 ≦ a ≦ 5,000,000,a.
: Multisets and Sequences ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11023: Multisets and Sequences 解題者:葉貫中 解題日期: 2007 年 4 月 24 日 題意:在這個題目中,我們要定義.
:Nuts for nuts..Nuts for nuts.. ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 10944:Nuts for nuts.. 解題者:楊家豪 解題日期: 2006 年 2 月 題意: 給定兩個正整數 x,y.
資料結構實習-一 參數傳遞.
: Flea circus ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10938: Flea circus 解題者:李育賢 解題日期: 2008 年 6 月 6 日 題意:題目會給定一些點當做樹與樹枝或樹葉連 接的地方 ( 最多.
政治大學公企中心必修課-- 社會科學研究方法(量化分析)--黃智聰
Dynamic Multi-signatures for Secure Autonomous Agents Panayiotis Kotzanikolaou Mike Burmester.
Section 4.2 Probability Models 機率模式. 由實驗看機率 實驗前先列出所有可能的實驗結果。 – 擲銅板:正面或反面。 – 擲骰子: 1~6 點。 – 擲骰子兩顆: (1,1),(1,2),(1,3),… 等 36 種。 決定每一個可能的實驗結果發生機率。 – 實驗後所有的實驗結果整理得到。
演算法 8-1 最大數及最小數找法 8-2 排序 8-3 二元搜尋法.
: Ubiquitous Religions ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10583: Ubiquitous Religions 解題者:吳佳樺 解題日期: 2010 年 3 月 18 日 題意: 一開始給予兩個數字.
845: Gas Station Numbers ★★★ 題組: Problem Set Archive with Online Judge 題號: 845: Gas Station Numbers. 解題者:張維珊 解題日期: 2006 年 2 月 題意: 將輸入的數字,經過重新排列組合或旋轉數字,得到比原先的數字大,
Chapter 10 m-way 搜尋樹與B-Tree
2005/7 Linear system-1 The Linear Equation System and Eliminations.
: Problem E Antimatter Ray Clearcutting ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11008: Problem E Antimatter Ray Clearcutting 解題者:林王智瑞.
連續隨機變數 連續變數:時間、分數、重量、……
: Searching for Nessy ★☆☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 11044: Searching for Nessy 解題者:王嘉偉 解題日期: 2007 年 5 月 22 日 題意: 給定 case 數量.
McGraw-Hill/Irwin © 2003 The McGraw-Hill Companies, Inc.,All Rights Reserved. 參 資料蒐集的方法.
: SAM I AM ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11419: SAM I AM 解題者:李重儀 解題日期: 2008 年 9 月 11 日 題意: 簡單的說,就是一個長方形的廟裡面有敵人,然 後可以橫的方向開砲或縱向開砲,每次開砲可以.
:Count the Trees ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10007:Count the Trees 解題者:楊家豪 解題日期: 2006 年 3 月 題意: 給 n 個點, 每一個點有自己的 Label,
:Rings and Glue ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10301: Rings and Glue 解題者:施博修 解題日期: 2011 年 5 月 18 日 題意:小約翰有了個大麻煩,他不小心將 rings.
幼兒行為觀察與記錄 第八章 事件取樣法.
: How many 0's? ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 11038: How many 0’s? 解題者:楊鵬宇 解題日期: 2007 年 5 月 15 日 題意:寫下題目給的 m 與 n(m
9.8 Solution of Differential Equations by Means of Taylor Series.
Discrete Mathematics Chapter 4 Induction and Recursion 大葉大學 資訊工程系 黃鈴玲 (Lingling Huang)
1 柱體與錐體 1. 找出柱體與錐體的規則 2. 柱體的命名與特性 3. 柱體的展開圖 4. 錐體的命名與特性 5. 錐體的展開圖
Discrete Mathematics Chapter 3 Mathematical Reasoning, Induction, and Recursion 感謝 大葉大學 資訊工程系 黃鈴玲老師 提供.
Graph Theory Chapter 7 Eulerian Graphs 大葉大學 (Da-Yeh Univ.) 資訊工程系 (Dept. CSIE) 黃鈴玲 (Lingling Huang)
Discrete Mathematics Chapter 7 Advanced Counting Techniques 大葉大學 資訊工程系 黃鈴玲.
Graph Theory Chapter 5 Networks 大葉大學 (Da-Yeh Univ.) 資訊工程系 (Dept. CSIE) 黃鈴玲 (Lingling Huang)
Introduction to DNA Computing Introducer: 黃宏偉 Adviser: 楊昌彪 教授.
Discrete Mathematics Chapter 2 Basic Structures : Sets, Functions, Sequences, and Sums 大葉大學 資訊工程系 黃鈴玲 (Lingling Huang)
Chapter 3 Trees and Forests 大葉大學 資訊工程系 黃鈴玲
Chapter 6 Connectivity and Flow 大葉大學 資訊工程系 黃鈴玲
5.8 Graph Matching  Example: Set of worker assign to a set of task  Four tasks are to be assigned to four workers.  – Worker 1 is qualified to do tasks.
Discrete Mathematics Chapter 7 Relations 感謝 大葉大學 資訊工程系 黃鈴玲老師 提供.
Discrete Mathematics Section 3.7 Applications of Number Theory 大葉大學 資訊工程系 黃鈴玲.
Graph Theory Chapter 4 Paths and Distance in Graphs 大葉大學 (Da-Yeh Univ.) 資訊工程系 (Dept. CSIE) 黃鈴玲 (Lingling Huang)
6.1.3 Graph representation.
Discrete Mathematics Chapter-8 Graphs 感謝 大葉大學 資訊工程系 黃鈴玲老師 提供.
Graph Theory Chapter 10 Coloring Graphs 大葉大學 (Da-Yeh Univ.) 資訊工程系 (Dept. CSIE) 黃鈴玲 (Lingling Huang)
Graph Theory Chapter 8 Hamiltonian Graphs 大葉大學 (Da-Yeh Univ.) 資訊工程系 (Dept. CSIE) 黃鈴玲 (Lingling Huang)
大葉大學 資訊工程系 黃鈴玲  G. Agnarsson and R. Greenlaw, Graph Theory: Modeling, Applications, and Algorithms, Pearson,  G. Chartrand and O. R. Oellermann,
Chapter 7 Planar Graphs 大葉大學 資訊工程系 黃鈴玲  7.2 Planar Embeddings  7.3 Euler’s Formula and Consequences  7.4 Characterization of Planar Graphs.
Chapter 10 Independence, Dominance, and Matchings
Chapter 13 Graph Algorithms
Discrete Mathematics Chapter-8 Graphs.
6.1.3 Graph representation.
Presentation transcript:

Graph Theory Chapter 6 Matchings and Factorizations 大葉大學 (Da-Yeh Univ.) 資訊工程系 (Dept. CSIE) 黃鈴玲 (Lingling Huang)

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

Copyright  黃鈴玲 Ch 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.

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 ?

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.

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.

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.

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)

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.

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.

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 v4v

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.

Copyright  黃鈴玲 Ch6-13 An augmenting path P of G : P 中的邊將  M 的與  M 的性質交換, M 中的邊數會加一。 MMMM MMMM MMMM MMMM MMMM MMMM Single vertex

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)

Copyright  黃鈴玲 Ch6-15 G : H : ( V ( H )= V ( G ) ) H 裡沒有 degree  3 的點 M1M2M1M2 Example:

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

Copyright  黃鈴玲 Ch6-17 Homework Exercise 6.1: 1

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

Copyright  黃鈴玲 Ch 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 For j = 1, 2, …, p and j  i, let Tree( v j )= F. ( 表示 v j 不在 alternating tree 中 ) Also, Tree( v i )= T.

Copyright  黃鈴玲 Ch 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 Suppose that N(x)={y 1, y 2, …, y k }. Let j  If j  k, then y  y j ; otherwise, return to Step Suppose that N(x)={y 1, y 2, …, y k }. Let j  If j  k, then y  y j ; otherwise, return to Step If Tree( y )= T, then j  j + 1 and return to Step 4.3.2; otherwise, continue 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 Otherwise, y is a single vertex ( 找到了 ! ) and we continue Use array Parent to determine the alternating v - x path P’ in the tree. Let P  P’ U{ xy } be the augmenting path If Tree( y )= T, then j  j + 1 and return to Step 4.3.2; otherwise, continue 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 Otherwise, y is a single vertex ( 找到了 ! ) and we continue 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.

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

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.

Copyright  黃鈴玲 Ch6-23 Homework Exercise 6.2: 3

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

Copyright  黃鈴玲 Ch 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 中允許點重複, 但每點不可同時是自己的祖先

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

Copyright  黃鈴玲 Ch Initial matching M 1 Example (Fig 6.10) Augmenting path 1 8 6

Copyright  黃鈴玲 Ch6-28 Homework Exercise 6.3: 3 ( 先任給一個 matching)

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

Copyright  黃鈴玲 Ch 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.

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.

Copyright  黃鈴玲 Ch6-32 H1H1 H H2H2 H3H3 A 1-factorization of K 3,3

Copyright  黃鈴玲 Ch6-33 H A 2-factorization of K 5 H1H1 H2H2

Copyright  黃鈴玲 Ch6-34 A 1-factorable cubic (3-regular)graph G H2H2 H3H3 H1H1

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 的分解方法 )

Copyright  黃鈴玲 Ch6-36 A 1-factorization of K 6 H1H1 H2H2 H3H3 H4H4 H5H5 中心點 v 每次先連一點 x ,再將剩下的點配對, 產生的邊需垂直於 vx

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.

Copyright  黃鈴玲 Ch 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

Copyright  黃鈴玲 Ch6-39 Petersen Graph ( 在圖論的一些性質中常扮演反例的角色 ) Petersen graph is not 1-factorable. ( 證明略過 )

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.