Graph Theory Chapter 8 Hamiltonian Graphs 大葉大學 (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
Graph Theory Chapter 9 Planar Graphs 大葉大學 資訊工程系 黃鈴玲.
布林代數的應用--- 全及項(最小項)和全或項(最大項)展開式
: A-Sequence 星級 : ★★☆☆☆ 題組: Online-judge.uva.es PROBLEM SET Volume CIX 題號: Problem D : A-Sequence 解題者:薛祖淵 解題日期: 2006 年 2 月 21 日 題意:一開始先輸入一個.
1 集合論 Chapter 3. 2 Chapter 3 Set Theory 3.1 Sets and Subsets A well-defined collection of objects (the set of outstanding people, outstanding is very.
指導教授:陳淑媛 學生:李宗叡 李卿輔.  利用下列三種方法 (Edge Detection 、 Local Binary Pattern 、 Structured Local Edge Pattern) 來判斷是否為場景變換,以方便使用者來 找出所要的片段。
Review of Chapter 3 - 已學過的 rules( 回顧 )- 朝陽科技大學 資訊管理系 李麗華 教授.
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,
: 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.
JAVA 程式設計與資料結構 第十章 GUI Introdution III. File Chooser  File Chooser 是一個選擇檔案的圖形介面, 無論我們是要存檔還是要開啟檔案,使 用這個物件都會讓我們覺得容易且舒適。
1 第四章 多變數函數的微分學 § 4.1 偏導數定義 定義 極限值 ■. 2 定理 極限值的基本定理 (1) 極限值的唯一性 : 若 存在,則 其值必為唯一。 (2) 若 且 ( 與 為常數 ) , 則 且 為常數且.
Introduction to Java Programming Lecture 17 Abstract Classes & Interfaces.
: The largest Clique ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11324: The largest Clique 解題者:李重儀 解題日期: 2008 年 11 月 24 日 題意: 簡單來說,給你一個 directed.
3-3 使用幾何繪圖工具 Flash 的幾何繪圖工具包括線段工具 (Line Tool) 、橢圓形工具 (Oval Tool) 、多邊星形 工具 (Rectangle Tool) 3 種。這些工具畫出 來的幾何圖形包括了筆畫線條和填色區域, 將它們適當地組合加上有技巧地變形與配 色, 不但比鉛筆工具簡單,
: Happy Number ★ ? 題組: Problem Set Archive with Online Judge 題號: 10591: Happy Number 解題者:陳瀅文 解題日期: 2006 年 6 月 6 日 題意:判斷一個正整數 N 是否為 Happy Number.
: Fast and Easy Data Compressor ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10043: Fast and Easy Data Compressor 解題者:葉貫中 解題日期: 2007 年 3.
各種線上電子資源的特異功能 SpringerLINK 的 Alert, Serials Update, News 2003/4/28 修改.
: 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.
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
: A-Sequence ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10930: A-Sequence 解題者:陳盈村 解題日期: 2008 年 5 月 30 日 題意: A-Sequence 需符合以下的條件, 1 ≤ a.
JAVA 程式設計與資料結構 第二十章 Searching. Sequential Searching Sequential Searching 是最簡單的一種搜尋法,此演 算法可應用在 Array 或是 Linked List 此等資料結構。 Sequential Searching 的 worst-case.
演算法 8-1 最大數及最小數找法 8-2 排序 8-3 二元搜尋法.
-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
演算法課程 (Algorithms) 國立聯合大學 資訊管理學系 陳士杰老師 Course 7 貪婪法則 Greedy Approach.
1 523: Minimum Transport Cost ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 523: Minimum Transport Cost 解題者:林祺光 解題日期: 2006 年 6 月 12 日 題意:計算兩個城市之間最小的運輸成本,運輸.
JAVA 程式設計與資料結構 第十六章 Hash Tables. Introduction Hash Tables 結構為一個 Array ,稱之為 Bucket array 。 如果想要新增一個物件,要根據這個物件的特性 將其加入 Hash Table 內。 Bucket Array 用 A 來代替,其.
2005/7 Linear system-1 The Linear Equation System and Eliminations.
5 重複迴圈 5.1 增減運算符號 增量運算符號 減量運算符號
: Problem E Antimatter Ray Clearcutting ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11008: Problem E Antimatter Ray Clearcutting 解題者:林王智瑞.
Visual C++重點複習.
Course 7 貪婪法則 Greedy Approach
: Place the Guards ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 11080: Place the Guards 解題者:陳盈村 解題日期: 2008 年 3 月 26 日 題意:有一個國王希望在他的城市裡佈置守衛,
: SAM I AM ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11419: SAM I AM 解題者:李重儀 解題日期: 2008 年 9 月 11 日 題意: 簡單的說,就是一個長方形的廟裡面有敵人,然 後可以橫的方向開砲或縱向開砲,每次開砲可以.
: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.
幼兒行為觀察與記錄 第八章 事件取樣法.
CH 14-可靠度工程之數學基礎 探討重點 失效時間之機率分配 指數模式之可靠度工程.
: 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 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)
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 大葉大學 資訊工程系 黃鈴玲
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 感謝 大葉大學 資訊工程系 黃鈴玲老師 提供.
Graph Theory Chapter 10 Coloring 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
Presentation transcript:

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

Copyright  黃鈴玲 Ch8-2 Outline 8.1 An Introduction to Hamiltonian Graphs 8.2 Which Graphs are Hamiltonian? 8.3 The Traveling Salesman Problem

Copyright  黃鈴玲 Ch An Introduction to Hamiltonian Graphs Definition: A graph of G is called Hamiltonian if G has a spanning cycle. A dodecahedron ( 正 12 面體 )  A hamiltonian cycle

Copyright  黃鈴玲 Ch8-4 Knight ’ s Tour Puzzle Is it possible for a knight to tour the chessboard ( n  n ), that is, visit each square exactly once and return to its initial square? 4  4 chessboard: 此走法不存在 8  8 chessboard: 存在, see Fig 8-2

Copyright  黃鈴玲 Ch8-5 pf: (By induction on n ) Base: (n=3) OK Inductive: Assume the (n  1)- cube is hamiltonian. Consider the n -cube: Ex1: Show that the graph of the n -cube is hamiltonian. 3 - cube ( n  1)-cube x y y’y’ x’x’

Copyright  黃鈴玲 Ch8-6 Ex2: Show that the graph G below is not hamiltonian. hamiltonian cycle 必定包含這些 edge.  hamiltonian cycle 必定包含這些 edge. Hint: 考慮通過此三點的 edge 本身已構成 cycle , 故不可能 hamiltonian  本身已構成 cycle , 故不可能 hamiltonian

Copyright  黃鈴玲 Ch8-7 Observe: hamiltonian. 1. C n ( n  3) is hamiltonian. hamiltonian. 2. K n ( n  3) is hamiltonian. hamiltonian. 3. A connected graph with cut-vertices is not hamiltonian.

Copyright  黃鈴玲 Ch8-8 G1G1 G3G3 GnGn G2G2 pf: G is hamiltonian   a hamiltonian cycle C Suppose k ( G  S ) = n, where G 1, G 2, …, G n are components of G  S. Suppose k ( G  S ) = n, where G 1, G 2, …, G n are components of G  S. Let u i (1  i  n ) be the last vertex of C that belongs to G i. Let u i (1  i  n ) be the last vertex of C that belongs to G i. Let v i be the vertex that immediately follows u i on C. ( u i 的下一點即是 v i 且 v i  S ) Let v i be the vertex that immediately follows u i on C. ( u i 的下一點即是 v i 且 v i  S ) Thm 8.1: If G is hamiltonian, than k ( G  S )  | S | for every S  V(G), S  . If G is hamiltonian, than k ( G  S )  | S | for every S  V(G), S  . C … v1v1 v3v3 vnvn v2v2 u1u1 unun u3u3 u2u2

Copyright  黃鈴玲 Ch8-9  (1) v i  S,  i (2) v j  v k, if j  k  (1) v i  S,  i (2) v j  v k, if j  k  | S |  n  | S |  n ∴ k ( G  S )  ||. ∴ k ( G  S )  | S |. G1G1 G3G3 GnGn G2G2 C … v1v1 v3v3 vnvn v2v2 u1u1 unun u3u3 u2u2

Copyright  黃鈴玲 Ch8-10 pf: 例如 K 2,3 上與下兩個 part 點數不一致 ∴ 無法有 hamiltonian cycle 上與下兩個 part 點數不一致 ∴ 無法有 hamiltonian cycle Ex5: Show that no bipartite graph of odd order is hamiltonian.

Copyright  黃鈴玲 Ch8-11 Homework Exercise 8.1: 1, 2, 3, 4, 5

Copyright  黃鈴玲 Ch8-12 Outline 8.1 An Introduction to Hamiltonian Graphs 8.2 Which Graphs are Hamiltonian? 8.3 The Traveling Salesman Problem

Copyright  黃鈴玲 Ch Which Graphs are Hamiltonian? Thm 8.2 (Dirac’s Thm) G : order p  3 If deg(v)  p/2  v  V(G), then G is Hamiltonian. deg(v)  2  v  V(G)  G  C 3 Pf: (1) If p = 3  deg(v)  2  v  V(G)  G  C 3  4, let P : v 1,v 2,…, v n (2) If p  4, let P : v 1,v 2,…, v n be a longest path in G. v1v1 v2v2 v3v3 v n-1 vnvn

Copyright  黃鈴玲 Ch8-14 Then every neighbor of v 1 and v n is on P. ∵ ∵ deg(v)  p/2 ∴ n ∴ n  1+p/2  Claim:  v i  V(P), 2  i  n, s. t., v 1 ~ v i and v i  1 ~ v n. pf of claim: If not,  v j with v j ~ v 1  v j  1 ~ v n ∵ ∵ deg(v 1 )  p/2 ∴至少有 p/2 個點與不相連 ∴ v 1 到 v n  1 中至少有 p/2 個點與 v n 不相連 ∵ ∵ deg(v n )  p/2 ∴此 path 至少有 個點  ∴此 path 至少有 p/2 + p/2 + 1 個點  v1v1 v2v2 v3v3 vi1vi1 vnvn v n-1 vivi (vn)(vn)

Copyright  黃鈴玲 Ch8-15 Let C : v 1, v 2, …, v i  1, v n, v n  1, …, v i, v 1 C is a cycle of length n. If n < p then  u  V(G  C) ∵ ∵ deg(u)  p/2, | V(C) | = n  1+ p/2 ∴ ∴  v k s.t. u ~ v k (1  k  n) ∴ C ∪ {}  ∴ C ∪ { uv k } contains a path longer than P.   n = p   C is a Hamiltonian cycle. ※ Thm8.2 中 deg(v)  p/2 的條件若改為 (p  1)/2 則不保證存在 hamiltonian cycle. 例 : K n, n+1 v1v1 v2v2 v3v3 vi1vi1 vnvn v n-1 vivi

Copyright  黃鈴玲 Ch8-16 ※ Thm8.2 不能 cover 的例子 : (1) C n ( n  5): hamiltonian p  5, deg(v i ) = 2< p/2  i (2) +( K m U K n ): hamiltonian Fig 8-5: +( K 2 U K 3 ) p = m + n + 2 Suppose m < n, deg(v) = m + 1 < p/2 if v  V(K m )

Copyright  黃鈴玲 Ch8-17 Thm8.3 Let G be a graph of order p  3. Suppose u and v are nonadjacent vertices of G s.t. deg(u) + deg(v)  p. Then G is hamiltonian iff G + uv is hamiltonian. Pf: “  ”: trivial. “  ”: Let C be a hamiltonian cycle of G+uv. If uv  C  G is hamiltonian. If uv  C   spanning u-v path P (P = C  uv)

Copyright  黃鈴玲 Ch8-18 P : ( P 上使用了所有點 ) Similar as the proof of Thm8.2, G has a hamiltonian cycle. u v

Copyright  黃鈴玲 Ch8-19 上述定理提供了判斷圖形是否 hamiltonian 的一種方法  重複將不相連但 degree 和  p 的兩點連一條邊 新圖形是否 hamiltonian 決定了原圖是否 hamiltonian Fig 8-6   p=7 Not hamiltonian!

Copyright  黃鈴玲 Ch8-20 Def: A closure c(G) of a graph G of order p is a graph obtained from G by recursively joining pairs of nonadjacent vertices whose degree sum is at least p until no such pairs remain. A closure c(G) of a graph G of order p is a graph obtained from G by recursively joining pairs of nonadjacent vertices whose degree sum is at least p until no such pairs remain. c(G) is unique. ※ c(G) is unique.

Copyright  黃鈴玲 Ch8-21 Thm8.5 G is hamiltonian  c(G) is hamiltonian. Cor8.5(a)  K p, then G is hamiltonian. Let G be a graph of order p  3. If c(G)  K p, then G is hamiltonian. Fig 8.7  G is hamiltonian.  K9c(G)  K9 K9c(G)  K9 G

Copyright  黃鈴玲 Ch8-22 Cor8.5(b) then G is hamiltonian. |V(G)| = p  3. u,v  V(G). If deg(u) + deg(v)  p  u ~ v, then G is hamiltonian. Cor8.5(c) Then G is hamiltonian. |V(G)| = p  3. Let d 1, d 2, …d p be the degree sequence of G with d 1  d 2  …  d p. Suppose for every k < p/2, d k  k  d p  k  p  k. Then G is hamiltonian. Cor8.5(d) then G is hamiltonian. |V(G)| = p, |E(G)| = q. If q , then G is hamiltonian.

Copyright  黃鈴玲 Ch8-23 Ex5. Show that if a graph of order 3 has an isolated vertex or an end-vertex, then its closure is not complete. Ex5. Show that if a graph of order at least 3 has an isolated vertex or an end-vertex, then its closure is not complete. pf: (1) If u is an isolated vertex of graph G, then deg(u) = 0, deg(v)  p  2 for every vertex v  u.  In c(G), u ~ v  u  v  c(G)  Kp c(G)  Kp (2) If u is an end-vertex then deg(u) = 1, deg(v)  p  2 if u ~ v  c(G)  Kp c(G)  Kp

Copyright  黃鈴玲 Ch8-24 Homework Exercise 8.2: 1, 3, 4, 8, 9, 11

Copyright  黃鈴玲 Ch8-25 Outline 8.1 An Introduction to Hamiltonian Graphs 8.2 Which Graphs are Hamiltonian? 8.3 The Traveling Salesman Problem

Copyright  黃鈴玲 Ch The Traveling Salesman Problem  G : connected weighted graph, v i  V(G) : the cities, w(v i v j ) of edge v i v j : the distance to travel directly between v i and v j. (Assume that G is complete) TSP: Suppose that a salesman is required to make a round trip through a given collection of p (  3) cities. What route should he take to minimize the total distance traveled? ※ TSP asks for a Hamiltonian cycle of minimum weight.

Copyright  黃鈴玲 Ch8-27 此處提供兩種作法 前提 : 需先符合 triangle inequality ( 三角不等式 ) w(v i,v k )  w(v i,v j ) + w(v j,v k ) w(v i,v k )  w(v i,v j ) + w(v j,v k ) vivi vjvj vkvk ∵ NP-complete ∴改成 find low weight 的 HC TSP: Given a weighted complete graph G and a positive constant B, does there exist a hamiltonian cycle C in G so that w(C)  B ?

Copyright  黃鈴玲 Ch8-28 Algorithm 8.1 (a greedy algorithm) [ To determine a low weight HC in a weighted complete graph G of order p  3 satisfying the triangle inequality. ] 1. n  1. ( n is the cycle length) 2.Select any vertex of G to form C n. ( C n 剛開始只有一個點 ) 3.If n < p, then find a vertex v n not on C n s.t. w(u n v n ) is minimum for some u n is on C n, and go to Step 4. Otherwise, C n is the desired HC. 4.Let C n+1 be the ( n+1 )-cycle obtained by inserting v n immediately before u n on C n. 5. n  n +1 and return to Step 3.

Copyright  黃鈴玲 Ch C 1 : v 1 2. ∵ v 2, …, v 6 中, w(v 1 v 4 ) 最小 ∴ C 2 : v 1 v 4 v 1 ∴ C 2 : v 1 v 4 v 13. ∵ w(v 3 v 4 ) 最小 ∵ w(v 3 v 4 ) 最小 ∴ C 3 : v 1 v 3 v 4 v 1 ( 加在要連的點之前 ) ∴ C 3 : v 1 v 3 v 4 v 1 ( 加在要連的點之前 ) v 1 v 2 v 3 v 4 v 5 v 6 v1v2v3v4v5v6v1v2v3v4v5v6 Fig 8-10 v 2 v 3 v 5 v 6 v1 v4 v1 v4

Copyright  黃鈴玲 Ch8-30 v 2 v 5 v 6 v1 v3 v4 v1 v3 v v 5 v 6 v1 v2 v3 v4 v1 v2 v3 v4 v 5 v1 v2 v3 v4 v6 v1 v2 v3 v4 v ∵ w(v 1 v 2 ) 最小 ∴ C 4 : v 1 v 3 v 4 v 2 v C5: v1v3v4v2v6v1C5: v1v3v4v2v6v1C5: v1v3v4v2v6v1C5: v1v3v4v2v6v1 C 6 : v 1 v 5 v 3 v 4 v 2 v 6 v 1 4. C 6 的 weight 總和為 24, 而 min weight 為 18. 若改選別的點當 C 1, 可能 weight 總和更小.

Copyright  黃鈴玲 Ch8-31 Thm 8.8 : a given by Algorithm 8.1 C : a HC given by Algorithm 8.1 : min weight C m : min weight HC ()  2  ()  w(C)  2  w(C m ) (Algorithm 8.1 不保證能找出 min HC, 但用 Algorithm 8.1 找出的 cycle 其 weight 但用 Algorithm 8.1 找出的 cycle 其 weight 不會大於 min HC 的兩倍.) 不會大於 min HC 的兩倍.)

Copyright  黃鈴玲 Ch8-32 Algorithm8.2 ( 利用 min spanning tree) 1. Find a min spanning tree T of G. 2. Conduct a depth-first search of T. ( 起點為 T 的 leaf) 3. If v i 1, v i 2, …, v i p is the order in which the vertices of T are visited in step 2, then output the hamiltonian cycle v i 1, v i 2, …, v i p, v i 1. [ To determine a low weight HC in a weighted complete graph G of order p  3 satisfying the triangle inequality. ] (Algorithm 8.2 找出的 cycle 其 weight 也不會大於 min HC 的兩倍.)

Copyright  黃鈴玲 Ch8-33 Fig 8-13 ( 原圖同 Fig 8-10) C: v 2,v 1,v 4,v 3,v 5,v 6,v 2 v2v2 v5v5 v4v4 v3v3 v1v1 v6v6 A min spanning tree T (a) A depth-first search 從 v 2 開始 (b) 1 v2v2 v5v5 v4v4 v3v3 v1v1 v6v6 A HC (c) weight 總和為 19

Copyright  黃鈴玲 Ch8-34 Exercise 8 Use Alg. 8.1 and 8.2 to find a closed walk whose weight does not exceed twice the weight of a shortest closed walk in the given weighted graph G. Sol: 先把 G 變成 complete G v2v2 v5v5 v4v4 v3v3 v1v G v2v2 v5v5 v4v4 v3v3 v1v v 1 v 2 v 3 v 4 v 5 v1v2v3v4v5v1v2v3v4v5

Copyright  黃鈴玲 Ch8-35 Homework Exercise 8.3: 1, 3, 4, 8