240 likes | 458 Views
Graph Theory Chapter 7 Eulerian Graphs. 大葉大學 (Da-Yeh Univ.) 資訊工程系 (Dept. CSIE) 黃鈴玲 (Lingling Huang). Outline. 7.1 An Introduction to Eulerian Graphs 7.2 Characterizing Eulerian Graphs Again 7.3 The Chinese Postman Problem. 7.1 An Introduction to Eulerian Graphs.
E N D
Graph TheoryChapter 7 Eulerian Graphs 大葉大學(Da-Yeh Univ.)資訊工程系(Dept. CSIE)黃鈴玲(Lingling Huang)
Outline 7.1 An Introduction to Eulerian Graphs 7.2 Characterizing Eulerian Graphs Again 7.3 The Chinese Postman Problem
7.1 An Introduction to Eulerian Graphs • 1736, Euler solved the Königsberg Bridge Problem (七橋問題) Q: 是否存在一 種走法,可以走過每座橋一次,並回到起點?
C A D B Königsberg Bridge Problem 陸地為點 橋為邊 Q: 是否存在一種走法,可以走過每條邊一次,並回到起點? Ans: 因為每次經過一個點,都需要從一條邊進入該點,再用另一條邊離開,所以經過每個點一次要使用掉一對邊。 每個點上連接的邊數必須是偶數才行 此種走法不存在
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.
u9 u8 v1 u2 G2 G1 v2 u3 u1 v6 v3 u4 u7 u5 u6 v5 v4 eulerian circuit: eulerian trail:
Theorem 7.1:A connected multigraph G is eulerian if and only if the degree of each vertex is even. Pf: () Gis eulerian eulerian circuit C C 通過每一點時需用一條邊進入,用另一條邊離開 the degree of each vertex is even () Suppose every vertex of Gis even. (Now we construct an eulerian circuit.)
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 wv, 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. If E(T) E(G), 在G-T中重複此法找出一個個的circuit,連接起來即可得eulerian circuit.
T2 Figure 7.4 (Algorithm 7.1, Eulerian circuit) v2 Step 1: v1 T1:v1, v2, v3, v4, v5, v1 v5 v3 Step 2: v6 T2:v3, v5, v6, v3 v4 Step 3: C = T1T2 C:v1, v2, v3, v5, v6, v3, v4, v5, v1
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.
Homework Exercise 7.1: 1, 2
Outline 7.1 An Introduction to Eulerian Graphs 7.2 Characterizing Eulerian Graphs Again 7.3 The Chinese Postman Problem
7.2 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.
Example (Figure 7.5) Consider the edge uv, it belongs to five cycles: z C1:u, v, x, u x y a C2:u, v, y, x, u C3:u, v, y, z, x, u u v w b C4:u, v, w, y, z, x, u C5:u, v, w, y, x, u
個 個 個 Homework Exercise 7.2: 4(a) Ex4(a). Show that each edge of Kn belongs to at least 2n-2-1 cycles. C3: Example: K5 C4: C5:
Outline 7.1 An Introduction to Eulerian Graphs 7.2 Characterizing Eulerian Graphs Again 7.3 The Chinese Postman Problem
7.3 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
An alternative way to solve the Chinese Postman Problem:For a given connected graph G, determine an eulerian multigraphH of minimum size that contains G as its underlying graph. e. g., 將圖形G中的每個edge都複製一份 每點degree都會是偶數 新圖有eulerian circuit存在 the length of an eulerian walk of G is at least q but no more than 2q.
If G is not eulerian, then G contains an even number of odd vertices. Let V0(G) = {u1, u2, …, u2n}, n 1, be the set of odd vertices of G. Definition: A pair partition of V0(G) is a partition of V0(G) into n two-element subsets. For a pair partition p, given by p={{u11, u12}, {u21, u22}, …, {un1, un2}}. Let us define and let m(G) = min { d(p) | p is a pair partition }.
m(G )代表的是eulerian walk中重複走的邊數 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). • ※ How to find an eulerian walk of G? • Find a pair partition p with d(p) = m(G). • If p={{u11, u12}, {u21, u22}, …, {un1, un2}},determine shortestui1- ui2paths Qi. • duplicate the edges of G that are on Qi. • An eulerian circuit in the new graph provides an eulerian walk of G.
※How to find a pair partition p of V0(G) for which m(G)=d(p)? (1) Construct a complete weighted graph F K2n of order 2n, where V(F) =V0(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 即可)
1 u1 u2 3 3 2 4 u4 u3 3 u1 u4 u2 4 u1 u2 v4 v1 2 2 3 1 u3 u4 u3 v3 2 v2 Example (Fig 7.6, solving the Chinese Postman Problem) u1 (1) Find odd vertices u4 u2 (2) Graph F: v4 v1 u3 v3 v2 (4) add Qi: (3) Graph F’: Max matching
(5) Eulerian walk: e13 u1 u4 e1 u2 e12 e11 e2 e10 v4 v1 e4 e6 e9 e3 e5 u3 v3 e7 e8 v2 u1,e12, u2, e10, v3, e3, v4, e1, u4, e2, v4, e4, v3, e7, v2, e8, u3, e5, v3, e6, u3, e9, v1, e11, u2, e13, u1
Homework Exercise 7.3: 1, 3 Ex1. Prove that the length of an eulerian walk for a tree of size q is 2q.