Graph Theory Chapter 7 Eulerian Graphs 大葉大學 (Da-Yeh Univ.) 資訊工程系 (Dept. CSIE) 黃鈴玲 (Lingling Huang)

Slides:



Advertisements
Similar presentations
Algorithms Chapter 15 Dynamic Programming - Rod
Advertisements

Graph Theory Chapter 9 Planar Graphs 大葉大學 資訊工程系 黃鈴玲.
: Mars Buggy Problem ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 11018: Mars Buggy Problem 解題者:鍾正一 解題日期: 2007 年 4 月 17 日 題意:給定 N 個殖民地的經度以及緯度,接者輸.
FCU, Department of ECE, IC Design Research Lab. TEL: # 4945 Pre-SIm , Post-Sim.
: Arrange the Numbers ★★★☆☆ 題組: Contest Archive with Online Judge 題號: 11481: Arrange the Numbers 解題者:李重儀 解題日期: 2008 年 9 月 13 日 題意: 將數列 {1,2,3, …,N}
:Word Morphing ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10508:word morphing 解題者:楊家豪 解題日期: 2006 年 5 月 21 日 題意: 第一行給你兩個正整數, 第一個代表下面會出現幾個字串,
1 Q10276: Hanoi Tower Troubles Again! 星級 : ★★★ 題組: Online-judge.uva.es PROBLEM SET Volume CII 題號: Q10276: Hanoi Tower Troubles Again! 解題者:薛祖淵 解題日期: 2006.
: ACM CONTEST AND BLACKOUT ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10600: ACM CONTEST AND BLACKOUT 解題者:洪光燦 解題日期: 2006 年 6 月 12 日 題意:每個學校都需要電力,但是只有一台發電.
: Boxes ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 11003: Boxes 解題者:蔡欣燁 解題日期: 2007 年 3 月 19 日.
: Road Construction ★★★☆☆ 題組: Contest Archive with Online Judge 題號: 10724: Road Construction 解題者:徐文宏 解題日期: 2011 年 4 月 20 日 題意:給一個座標圖 (-1000~1000)
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,
:New Land ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11871: New Land 解題者:施博修 解題日期: 2011 年 6 月 8 日 題意:國王有一個懶兒子,為了勞動兒子,他想了一個 辦法,令他在某天早上開始走路,直到太陽下山前,靠.
: OPENING DOORS ? 題組: Problem Set Archive with Online Judge 題號: 10606: OPENING DOORS 解題者:侯沛彣 解題日期: 2006 年 6 月 11 日 題意: - 某間學校有 N 個學生,每個學生都有自己的衣物櫃.
8.1 何謂高度平衡二元搜尋樹 8.2 高度平衡二元搜尋樹的加入 8.3 高度平衡二元搜尋樹的刪除
: The Playboy Chimp ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10611: The Playboy Chimp 解題者:蔡昇宇 解題日期: 2010 年 2 月 28 日 題意:給一已排序的數列 S( 升冪.
Graph Theory Graph theory is the study of the properties of graph structures. It provides us with a language with which to talk about graphs.
Monte Carlo Simulation Part.2 Metropolis Algorithm Dept. Phys. Tunghai Univ. Numerical Methods C. T. Shih.
: The Scrooge Co Problem ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 11047: The Scrooge Co Problem 解題者:鍾正一 解題日期: 2007 年 6 月 5 日 題意:輸入 X.
: The largest Clique ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11324: The largest Clique 解題者:李重儀 解題日期: 2008 年 11 月 24 日 題意: 簡單來說,給你一個 directed.
: Point of View in Flatland ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 11037: Point of View in Flatland 解題者:黃士庭 解題日期: 2007 年 5 月 15 日 題意:在座標平面上給三個圓,找一個點使從這.
Johnson’s algorithm Johnson’s演算法可用於計算All pairs shortest path問題。
: Ahoy, Pirates! ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11402: Ahoy, Pirates! 解題者:李重儀 解題日期: 2008 年 8 月 26 日 題意:有一個海盜島有 N 個海盜,他們的編號 (id)
: 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 日 題意:在這個題目中,我們要定義.
最短路徑演算法 卓訓榮 2002/11/11 Data base Label Setting Algorithm Label Correcting Algorithm 運輸資訊.
- Calculus & It’s Application- Chapter 2 Introduction to Limits 朝陽科技大學 資訊管理系 李麗華 教授.
:Nuts for nuts..Nuts for nuts.. ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 10944:Nuts for nuts.. 解題者:楊家豪 解題日期: 2006 年 2 月 題意: 給定兩個正整數 x,y.
從此處輸入帳號密碼登入到管理頁面. 點選進到檔案管理 點選「上傳檔案」上傳資料 點選瀏覽選擇電腦裡的檔案 可選擇公開或不公開 為平台上的資料夾 此處為檔案分類,可顯示在展示頁面上,若要參加 MY EG 競賽,做品一律上傳到 “ 98 MY EG Contest ” 點選此處確定上傳檔案.
資料結構實習-一 參數傳遞.
6-2 認識元件庫與內建元件庫 Flash 的元件庫分兩種, 一種是每個動畫專 屬的元件庫 (Library) ;另一種則是內建元 件庫 (Common Libraries), 兩者皆可透過 『視窗』功能表來開啟, 以下即為您說明。
: Flea circus ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10938: Flea circus 解題者:李育賢 解題日期: 2008 年 6 月 6 日 題意:題目會給定一些點當做樹與樹枝或樹葉連 接的地方 ( 最多.
: Problem G e-Coins ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10306: Problem G e-Coins 解題者:陳瀅文 解題日期: 2006 年 5 月 2 日 題意:給定一個正整數 S (0
: Lucky Number ★★★★☆ 題組: Proble Set Archive with Online Judge 題號: 10909: Lucky Number 解題者:李育賢 解題日期: 2008 年 4 月 25 日 題意:給一個奇數數列 1,3,5,7,9,11,13,15…
演算法 8-1 最大數及最小數找法 8-2 排序 8-3 二元搜尋法.
: Ubiquitous Religions ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10583: Ubiquitous Religions 解題者:吳佳樺 解題日期: 2010 年 3 月 18 日 題意: 一開始給予兩個數字.
-Antidifferentiation- Chapter 6 朝陽科技大學 資訊管理系 李麗華 教授.
845: Gas Station Numbers ★★★ 題組: Problem Set Archive with Online Judge 題號: 845: Gas Station Numbers. 解題者:張維珊 解題日期: 2006 年 2 月 題意: 將輸入的數字,經過重新排列組合或旋轉數字,得到比原先的數字大,
Chapter 10 m-way 搜尋樹與B-Tree
A Search Procedure for Hamilton Paths and Circuits Frank Rubin JACM, Vol. 21, No. 4, pp , Oct
1 523: Minimum Transport Cost ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 523: Minimum Transport Cost 解題者:林祺光 解題日期: 2006 年 6 月 12 日 題意:計算兩個城市之間最小的運輸成本,運輸.
: Light, more light ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10110: Light, more light 解題者:吳政霖, 洪光燦 解題日期: 2006 年 4 月 9 日 題意:有個神奇的工友負責學校走廊上的燈泡的開關,
:Commandos ★★★☆☆ 題組: Contest Archive with Online Judge 題號: 11463: Commandos 解題者:李重儀 解題日期: 2008 年 8 月 11 日 題意: 題目會給你一個敵營區內總共的建築物數,以及建築物 之間可以互通的路有哪些,並給你起點的建築物和終點.
: SAM I AM ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11419: SAM I AM 解題者:李重儀 解題日期: 2008 年 9 月 11 日 題意: 簡單的說,就是一個長方形的廟裡面有敵人,然 後可以橫的方向開砲或縱向開砲,每次開砲可以.
: Finding Paths in Grid ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11486: Finding Paths in Grid 解題者:李重儀 解題日期: 2008 年 10 月 14 日 題意:給一個 7 個 column.
:Problem E.Stone Game ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10165: Problem E.Stone Game 解題者:李濟宇 解題日期: 2006 年 3 月 26 日 題意: Jack 與 Jim.
著作權所有 © 旗標出版股份有限公司 第 14 章 製作信封、標籤. 本章提要 製作單一信封 製作單一郵寄標籤.
: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
Discrete Mathematics Chapter 4 Induction and Recursion 大葉大學 資訊工程系 黃鈴玲 (Lingling Huang)
Graph Theory Chapter 5 Networks 大葉大學 (Da-Yeh Univ.) 資訊工程系 (Dept. CSIE) 黃鈴玲 (Lingling Huang)
Graph Theory Chapter 6 Matchings and Factorizations 大葉大學 (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 大葉大學 資訊工程系 黃鈴玲
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)
Discrete Mathematics Chapter-8 Graphs 感謝 大葉大學 資訊工程系 黃鈴玲老師 提供.
Combinatorial Mathematics
Graph Theory Chapter 10 Coloring Graphs 大葉大學 (Da-Yeh Univ.) 資訊工程系 (Dept. CSIE) 黃鈴玲 (Lingling Huang)
Introduction to Graph Theory
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
Graph Theory: Euler Graphs and Digraphs
Presentation transcript:

Graph Theory Chapter 7 Eulerian Graphs 大葉大學 (Da-Yeh Univ.) 資訊工程系 (Dept. CSIE) 黃鈴玲 (Lingling Huang)

Copyright  黃鈴玲 Ch7-2 Outline 7.1 An Introduction to Eulerian Graphs 7.2 Characterizing Eulerian Graphs Again 7.3 The Chinese Postman Problem

Copyright  黃鈴玲 Ch An Introduction to Eulerian Graphs 1736, Euler solved the Königsberg Bridge Problem ( 七橋問題 ) 1736, Euler solved the Königsberg Bridge Problem ( 七橋問題 ) Q: 是否存在一 種走法,可以走 過每座橋一次, 並回到起點?

Copyright  黃鈴玲 Ch7-4 Königsberg Bridge Problem Ans: 因為每次經過一個點,都需要從一條邊進入該點,再用另 一條邊離開,所以經過每個點一次要使用掉一對邊。  每個點上連接的邊數必須是偶數才行  此種走法不存在  A B C D Q: 是否存在一種走法,可以走過每條邊一次,並回 到起點? 陸地為點 橋為邊

Copyright  黃鈴玲 Ch7-5 Definition: (1) An eulerian circuit of a connected multigraph is a circuit ( 點可重複、邊不可重複 ) of G that contains all the edges of G. (2) A (multi)graph with an eulerian circuit is called an eulerian (multi)graph. (3) An eulerian trail of a connected multigraph G is an open trail ( 起點終點不同的 trail) of G that contains all the edges of G.

Copyright  黃鈴玲 Ch7-6 u9u9 u8u8 u2u2 u3u3 u4u4 u5u5 u6u6 u7u7 u1u1 G1G1 v5v5 v4v4 v3v3 v2v2 v1v1 v6v6 G2G2 eulerian circuit: eulerian trail:    

Copyright  黃鈴玲 Ch7-7 Theorem 7.1: A connected multigraph G is eulerian if and only if the degree of each vertex is even. Pf: (  ) G is eulerian   eulerian circuit C  C 通過每一點時需用一條邊進入,用另一條邊離開 the degree of each vertex is even  the degree of each vertex is even ()() Suppose every vertex of G is even. (Now we construct an eulerian circuit.)

Copyright  黃鈴玲 Ch7-8 Choose any vertex v and begin a trail T ( 邊不 可重複 ) at v as far as possible. If w is the last vertex of T, then any edge incident with w must belong to T. Claim: w = v Pf. If w  v, then each time w is encountered on T before the last time, one edge is used to enter w and another edge is used to exit from w. Since w has even degree. There must be at least one edge incident with w that does not belong to T, a contradiction.  Since w has even degree. There must be at least one edge incident with w that does not belong to T, a contradiction.  If E(T)  E(G ), 在 G  T 中重複此法找出一個個的 circuit ,連接起來即可得 eulerian circuit.

Copyright  黃鈴玲 Ch7-9 v1v1 v2v2 Figure 7.4 (Algorithm 7.1, Eulerian circuit) v3v3 v5v5 v4v4 v6v6 Step 1: T 1 : v 1, v 2, v 3, v 4, v 5, v 1 Step 2: T 2 : v 3, v 5, v 6, v 3 Step 3: C = T 1  T 2 C: v 1, v 2, v 3, v 5, v 6, v 3, v 4, v 5, v 1 T2T2

Copyright  黃鈴玲 Ch7-10 Theorem 7.2: Let G be a nontrivial connected multigraph. Then G contains an eulerian trail if and only if G has exactly two odd vertices. Furthermore, the trail begins at one of the odd vertices and terminates at the other.

Copyright  黃鈴玲 Ch7-11 Homework Exercise 7.1: 1, 2

Copyright  黃鈴玲 Ch7-12 Outline 7.1 An Introduction to Eulerian Graphs 7.2 Characterizing Eulerian Graphs Again 7.3 The Chinese Postman Problem

Copyright  黃鈴玲 Ch Characterizing Eulerian Graphs Again Theorem 7.3: A connected graph G is eulerian if and only if every edge of G lies on an odd number of cycles of G.

Copyright  黃鈴玲 Ch7-14 Example (Figure 7.5) C 1 : u, v, x, u z x a uv y wb Consider the edge uv, it belongs to five cycles: C 2 : u, v, y, x, u C 3 : u, v, y, z, x, u C 4 : u, v, w, y, z, x, u C 5 : u, v, w, y, x, u

Copyright  黃鈴玲 Ch7-15 Homework Exercise 7.2: 4( a ) Ex4(a). Show that each edge of K n belongs to at least 2 n  2  1 cycles. C4:C4: Example: K 5 C3:C3: 個個 C5:C5: 個

Copyright  黃鈴玲 Ch7-16 Outline 7.1 An Introduction to Eulerian Graphs 7.2 Characterizing Eulerian Graphs Again 7.3 The Chinese Postman Problem

Copyright  黃鈴玲 Ch The Chinese Postman Problem Chinese Postman Problem: Suppose that a letter carrier must deliver mail to every house in a small town. The carrier would like to cover the route in the most efficient way and then return to the post office. Definition: For a connected graph G, an eulerian walk is a shortest closed walk covering all the edges of G.  finding an eulerian walk

Copyright  黃鈴玲 Ch7-18 An alternative way to solve the Chinese Postman Problem: For a given connected graph G, determine an eulerian multigraph H of minimum size that contains G as its underlying graph. e. g., 將圖形 G 中的每個 edge 都複製一份  每點 degree 都會是偶數  每點 degree 都會是偶數  新圖有 eulerian circuit 存在  新圖有 eulerian circuit 存在  the length of an eulerian walk of G is at least q but no more than 2q.  the length of an eulerian walk of G is at least q but no more than 2q.

Copyright  黃鈴玲 Ch7-19 Definition: A pair partition of V 0 (G) is a partition of V 0 (G) into n two-element subsets. For a pair partition , given by  ={{ u 11, u 12 }, { u 21, u 22 }, …, { u n1, u n2 }}. Let us define and let m ( G ) = min { d (  ) |  is a pair partition }. If G is not eulerian, then G contains an even number of odd vertices. Let V 0 (G) = {u 1, u 2, …, u 2n }, n  1, be the set of odd vertices of G.

Copyright  黃鈴玲 Ch7-20 If G is eulerian, then m(G ) = 0. Theorem 7.4 If G is a connected graph of size q, then an eulerian walk of G has length q + m ( G ). m(G ) m(G ) 代表的是 eulerian walk 中重複走的邊數 ※ How to find an eulerian walk of G ? (1) Find a pair partition  with d (  ) = m ( G ). (2) If  ={{ u 11, u 12 }, { u 21, u 22 }, …, { u n1, u n2 }}, determine shortest u i1 - u i2 paths Q i. (3) duplicate the edges of G that are on Q i. (4) An eulerian circuit in the new graph provides an eulerian walk of G.

Copyright  黃鈴玲 Ch7-21 How to find a pair partition  of V 0 (G) for which m ( G )= d (  )? ※ How to find a pair partition  of V 0 (G) for which m ( G )= d (  )? (1) Construct a complete weighted graph F  K 2n of order 2n, where V ( F ) = V 0 (G), the weight of an edge in F is defined as the distance between the corresponding vertices in G. (2) Determine a perfect matching of F whose weight is as small as possible. (Let m be the maximum weight of F. 將 F 中每邊的 weight w 改為 m+1  w, find a maximum matching 即可 )

Copyright  黃鈴玲 Ch7-22 Example (Fig 7.6, solving the Chinese Postman Problem) u1u1 u2u2 v1v1 u3u3 v2v2 v3v3 v4v4 u4u4 (1) Find odd vertices (2) Graph F : u1u1 u2u2 u4u4 u3u (3) Graph F’ : u1u1 u2u2 u4u4 u3u Max matching (4) add Q i : u2u2 v1v1 u3u3 v2v2 v3v3 v4v4 u4u4 u1u1

Copyright  黃鈴玲 Ch7-23 (5) Eulerian walk: u2u2 v1v1 u3u3 v2v2 v3v3 v4v4 u4u4 u1u1 u 1,e 12, u 2, e 10, v 3, e 3, v 4, e 1, u 4, e 2, v 4, e 4, v 3, e 7, v 2, e 8, u 3, e 5, v 3, e 6, u 3, e 9, v 1, e 11, u 2, e 13, u 1 e 13 e 12 e6e6 e5e5 e 11 e9e9 e8e8 e7e7 e3e3 e4e4 e2e2 e1e1 e 10

Copyright  黃鈴玲 Ch7-24 Homework Exercise 7.3: 1, 3 Ex1. Prove that the length of an eulerian walk for a tree of size q is 2 q.