1 Lecture 5 (part 2) Graphs II Euler and Hamiltonian Path / Circuit Reading: Epp Chp 11.2, 11.3.

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

Discrete Mathematics University of Jazeera College of Information Technology & Design Khulood Ghazal Connectivity Lecture _13.
Chapter 8 Topics in Graph Theory
Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1.
Walks, Paths and Circuits Walks, Paths and Circuits Sanjay Jain, Lecturer, School of Computing.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
Graph-02.
 期中测验时间:本周五上午 9 : 40  教师 TA 答疑时间 : 周三晚上 6 : 00—8 : 30  地点:软件楼 315 房间,  教师 TA :李弋老师  开卷考试.
Graph Theory: Euler Circuits Christina Mende Math 480 April 15, 2013.
Graphs III (Trees, MSTs) (Chp 11.5, 11.6)
Lecture 21 Paths and Circuits CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Section 14.1 Intro to Graph Theory. Beginnings of Graph Theory Euler’s Konigsberg Bridge Problem (18 th c.)  Can one walk through town and cross all.
BY: MIKE BASHAM, Math in Scheduling. The Bridges of Konigsberg.
Section 2.1 Euler Cycles Vocabulary CYCLE – a sequence of consecutively linked edges (x 1,x2),(x2,x3),…,(x n-1,x n ) whose starting vertex is the ending.
What is the first line of the proof? a). Assume G has an Eulerian circuit. b). Assume every vertex has even degree. c). Let v be any vertex in G. d). Let.
Discrete Structures Chapter 7B Graphs Nurul Amelina Nasharuddin Multimedia Department.
Introduction to Graphs Lecture 18: Nov 16. Seven Bridges of Königsberg Is it possible to walk with a route that crosses each bridge exactly once?
An Euler Circuit is a cycle of an undirected graph, that traverses every edge of the graph exactly once, and ends at the same node from which it began.
Representing Graphs Wade Trappe. Lecture Overview Introduction Some Terminology –Paths Adjacency Matrix.
CTIS 154 Discrete Mathematics II1 8.2 Paths and Cycles Kadir A. Peker.
Homework collection Thursday 3/29 Read Pages 160 – 174 Page 185: 1, 3, 6, 7, 8, 9, 12 a-f, 15 – 20.
4/17/2017 Section 8.5 Euler & Hamilton Paths ch8.5.
MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 5,Wednesday, September 10.
Euler and Hamilton Paths
Euler Circuit Chapter 5. Fleury’s Algorithm Euler’s theorems are very useful to find if a graph has an Euler circuit or an Euler path when the graph is.
Eulerian Graphs CSE 331 Section 2 James Daly. Reminders Project 3 is out Covers graphs Due Friday.
GRAPH Learning Outcomes Students should be able to:
Slide 14-1 Copyright © 2005 Pearson Education, Inc. SEVENTH EDITION and EXPANDED SEVENTH EDITION.
Graph Theoretic Concepts. What is a graph? A set of vertices (or nodes) linked by edges Mathematically, we often write G = (V,E)  V: set of vertices,
(CSC 102) Lecture 29 Discrete Structures. Graphs.
Euler and Hamilton Paths
Euler and Hamilton Paths. Euler Paths and Circuits The Seven bridges of Königsberg a b c d A B C D.
CSNB143 – Discrete Structure Topic 9 – Graph. Learning Outcomes Student should be able to identify graphs and its components. Students should know how.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Based on slides by Y. Peng University of Maryland
Graphs.  Definition A simple graph G= (V, E) consists of vertices, V, a nonempty set of vertices, and E, a set of unordered pairs of distinct elements.
5.4 Graph Models (part I – simple graphs). Graph is the tool for describing real-life situation. The process of using mathematical concept to solve real-life.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Chapter 5 Graphs  the puzzle of the seven bridge in the Königsberg,  on the Pregel.
Aim: What is an Euler Path and Circuit?
Vertex-Edge Graphs Euler Paths Euler Circuits. The Seven Bridges of Konigsberg.
1.Quiz 5 due tomorrow afternoon in E309 from 1pm to 4pm. 2.Homework grades will be based on ten graded homework assignments (dropping the lowest one).
MAT 2720 Discrete Mathematics Section 8.2 Paths and Cycles
Lecture 52 Section 11.2 Wed, Apr 26, 2006
Chapter 6: Graphs 6.1 Euler Circuits
 Quotient graph  Definition 13: Suppose G(V,E) is a graph and R is a equivalence relation on the set V. We construct the quotient graph G R in the follow.
Review Euler Graph Theory: DEFINITION: A NETWORK IS A FIGURE MADE UP OF POINTS (VERTICES) CONNECTED BY NON-INTERSECTING CURVES (ARCS). DEFINITION: A VERTEX.
Chapter 11 - Graph CSNB 143 Discrete Mathematical Structures.
Introduction to Graph Theory
Euler and Hamiltonian Graphs
Graphs Rosen, Chapter 8. NOT ONE OF THESE! One of these!
(CSC 102) Lecture 30 Discrete Structures. Graphs.
1. 期中测验时间和地点: 11 月 4 日, 上午 9:40—11 : 40 地点: 教室 2. 答疑时间和地点: 1)11 月 1 日 ( 周五 )13:00—15:00 软件楼 319 2)11 月 2 日和 3 日, 14:00—17:00 软件楼 3 楼 机房讨论室.
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
9.5 Euler and Hamilton graphs. 9.5: Euler and Hamilton paths Konigsberg problem.
1 Lecture 5 (part 2) Graphs II (a) Circuits; (b) Representation Reading: Epp Chp 11.2, 11.3
An Introduction to Graph Theory
Euler and Hamiltonian Graphs
Euler and Hamiltonian Graphs
Euler Paths and Circuits
Graphs Rosen, Chapter 8.
Graph theory Definitions Trees, cycles, directed graphs.
Discrete Structures – CNS2300
Introduction to Graph Theory Euler and Hamilton Paths and Circuits
Euler and Hamilton Paths
Euler and Hamiltonian Graphs
Chapter 5 Graphs the puzzle of the seven bridge in the Königsberg,
Applied Combinatorics, 4th Ed. Alan Tucker
Discrete Math II Howon Kim
Discrete Math II Howon Kim
Presentation transcript:

1 Lecture 5 (part 2) Graphs II Euler and Hamiltonian Path / Circuit Reading: Epp Chp 11.2, 11.3

2 2. Euler Circuit Leonhard Euler (pronounced OIL-er) , Swiss Mathematician “Is it possible for a person to take a walk around the town of Königsberg, starting and ending at the same location and crossing each of the seven bridges exactly once?”

3 2.1 Euler Circuit (Definition) n Definition: Let G=(V,E) be a graph (simple or multigraph). An Euler Circuit for G is a simple circuit that contains every edge in E. n Implications: –‘simple circuit’: edges must be distinct… At most 1 traversal of each edge. –‘every edge in E’: … At least 1 traversal of each edge.

4 2.2 Euler Circuit Theorem n (Euler Circuit Theorem): Let G=(V,E) be a graph. G has an Euler circuit iff G is connected AND every vertex of G has even degree. n Proof Strategy: –(  )Assume: G has an Euler Circuit Prove:(1) G is connected; (2)  v  V, deg(v) = 2k (for some k) –(  ) Assume: G is connected and  v  V, deg(v) = 2k (for some k) Prove: G has an Euler Circuit

5 2.2 Euler Circuit Theorem (Proof  ) Proof (  ): Assume G=(V,E) has an Euler circuit. Show (1) G is connected, (2) (  v  V, deg(v) = 2k) To Prove: G is connected. (Defn of connected?) n Since G has an Euler Circuit, then let v 0 e 1 v 1 e 2 v 2 … e n-1 v n-1 e n v 0 …be the Euler Circuit. n Pick any 2 vertices x, y in V. n Now, x must be some v i and y must be some v j in the Euler circuit. ( Why? Since by definition, “An Euler circuit for G is a circuit that contains EVERY VERTEX in V…” ) If i  j then we have a path from x = v i e i+1 v i+1 … e j v j = y If i  j then we have a path from x = v i e i v i-1 … e j+1 v j = y n Therefore there is a path from x to y in V. n Therefore G is connected (by definition of connected graph).

6 2.2 Euler Circuit Theorem (Proof  ) Proof (  ): Assume G=(V,E) has an Euler circuit. Show (1) G is connected, (2) (  v  V, deg(v) = 2k) n Now, we prove (2)… n To show: that any vertex has an even degree. n Pick any vertex v in V. n Since G has an Euler circuit, then that circuit must pass through v (by defn of Euler circuit “… circuit that contains EVERY VERTEX in V…”) n Look at the circuit from the viewpoint of v as the starting vertex. n Each time v is exited through the use of one edge, it must be returned to by the use of another edge.

7 2.2 Euler Circuit Theorem (Proof  ) Proof (  ): Assume G=(V,E) has an Euler circuit. Show (1) G is connected, (2) (  v  V, deg(v) = 2k) v Each time v is exited through the use of one edge, it must be returned to by the use of another edge. If v has some more edges incident on it, the process repeats again (Why? Because Euler Circuit traverses every edge in E).

8 2.2 Euler Circuit Theorem (Proof  ) Proof (  ): Assume G=(V,E) has an Euler circuit. Show (1) G is connected, (2) (  v  V, deg(v) = 2k) v Each time v is exited through the use of one edge, it must be returned to by the use of another edge. If v has some more edges incident on it, the process repeats again (Why? Because Euler Circuit traverses every edge in E).

9 2.2 Euler Circuit Theorem (Proof  ) Proof (  ): Assume G=(V,E) has an Euler circuit. Show (1) G is connected, (2) (  v  V, deg(v) = 2k) v Each time v is exited through the use of one edge, it must be returned to by the use of another edge. Edges on v occur in exit / entry pairs! Degree of v must be a multiple of 2 => EVEN!!!

Euler Circuit Theorem (Proof  ) Proof (  ): Assume (1) G is connected, (2) (  v  V, deg(v) = 2k). Show G=(V,E) has (  ) an Euler circuit. Proof: The proof that there is (  ) an Euler circuit, will be given by an ALGORITHM for finding the circuit. n We first present the algorithm. n We next show that the algorithm is correct. n (1) It will ALWAYS terminate; and n (2) If it terminates, it will ALWAYS find the circuit.

Euler Circuit Theorem (Proof  ) Proof (  ): Assume (1) G is connected, (2) (  v  V, deg(v) = 2k). Show G=(V,E) has (  ) an Euler circuit. Step 1: Pick any vertex v  V as the starting vertex. n Step 2: Pick any sequence of adjacent vertices and edges starting and ending at v, and never repeating an edge. Let this circuit be C. C: v v v Proof: (The algorithm)

12 n Step 3: Does C contain every edge and vertex of G? n If ‘Yes’, then stop and output C, which is an Euler circuit. n If ‘No’… 2.2 Euler Circuit Theorem (Proof  ) Proof (  ): Assume (1) G is connected, (2) (  v  V, deg(v) = 2k). Show G=(V,E) has (  ) an Euler circuit. v C: v v Proof: (The algorithm)

Euler Circuit Theorem (Proof  ) Proof (  ): Assume (1) G is connected, (2) (  v  V, deg(v) = 2k). Show G=(V,E) has (  ) an Euler circuit. n Step 3a: Remove the circuit C from G creating G’. v C: v v Proof: (The algorithm) G

Euler Circuit Theorem (Proof  ) Proof (  ): Assume (1) G is connected, (2) (  v  V, deg(v) = 2k). Show G=(V,E) has (  ) an Euler circuit. n Step 3a: Remove the circuit C from G creating G’ C: v v Proof: (The algorithm) G’

Euler Circuit Theorem (Proof  ) Proof (  ): Assume (1) G is connected, (2) (  v  V, deg(v) = 2k). Show G=(V,E) has (  ) an Euler circuit. n Step 3b: Pick any vertex u common to C and G’ C: v v u = Proof: (The algorithm)

Euler Circuit Theorem (Proof  ) Proof (  ): Assume (1) G is connected, (2) (  v  V, deg(v) = 2k). Show G=(V,E) has (  ) an Euler circuit. n Step 3c: Pick any sequence of adjacent vertices and edges of G’, starting and ending at u, never repeating an edge, creating another circuit C’ C: v v u = Proof: (The algorithm)

Euler Circuit Theorem (Proof  ) Proof (  ): Assume (1) G is connected, (2) (  v  V, deg(v) = 2k). Show G=(V,E) has (  ) an Euler circuit. n Step 3c: Pick any sequence of adjacent vertices and edges of G’, starting and ending at u, never repeating an edge, creating another circuit C’ C: v vC’: u = Proof: (The algorithm)

Euler Circuit Theorem (Proof  ) Proof (  ): Assume (1) G is connected, (2) (  v  V, deg(v) = 2k). Show G=(V,E) has (  ) an Euler circuit. n Step 3d: PATCH C’ to C to form C’’: C: v vC’: u = Proof: (The algorithm)

Euler Circuit Theorem (Proof  ) Proof (  ): Assume (1) G is connected, (2) (  v  V, deg(v) = 2k). Show G=(V,E) has (  ) an Euler circuit. n Step 3d: PATCH C’ to C to form C’’: 1 v C: v vC’: u = (i) Start at v C’’: v Proof: (The algorithm)

Euler Circuit Theorem (Proof  ) Proof (  ): Assume (1) G is connected, (2) (  v  V, deg(v) = 2k). Show G=(V,E) has (  ) an Euler circuit. n Step 3d: PATCH C’ to C to form C’’: v C: v vC’: u = (i) Start at v (ii) Follow C to u C’’: v Proof: (The algorithm)

Euler Circuit Theorem (Proof  ) Proof (  ): Assume (1) G is connected, (2) (  v  V, deg(v) = 2k). Show G=(V,E) has (  ) an Euler circuit. n Step 3d: PATCH C’ to C to form C’’: v C: v vC’: u = (i) Start at v (ii) Follow C to u C’’: v Proof: (The algorithm)

Euler Circuit Theorem (Proof  ) Proof (  ): Assume (1) G is connected, (2) (  v  V, deg(v) = 2k). Show G=(V,E) has (  ) an Euler circuit. n Step 3d: PATCH C’ to C to form C’’: v C: v vC’: u = (i) Start at v (ii) Follow C to u (iii) Follow C’ from u all the way back to u C’’: v Proof: (The algorithm)

Euler Circuit Theorem (Proof  ) Proof (  ): Assume (1) G is connected, (2) (  v  V, deg(v) = 2k). Show G=(V,E) has (  ) an Euler circuit. n Step 3d: PATCH C’ to C to form C’’: v C: v vC’: u = (i) Start at v (ii) Follow C to u (iii) Follow C’ from u all the way back to u C’’: v Proof: (The algorithm)

Euler Circuit Theorem (Proof  ) Proof (  ): Assume (1) G is connected, (2) (  v  V, deg(v) = 2k). Show G=(V,E) has (  ) an Euler circuit. n Step 3d: PATCH C’ to C to form C’’: v C: v vC’: u = (i) Start at v (ii) Follow C to u C’’: v (iii) Follow C’ from u all the way back to u (iv) Return from u through untravelled portion of C to v Proof: (The algorithm)

Euler Circuit Theorem (Proof  ) Proof (  ): Assume (1) G is connected, (2) (  v  V, deg(v) = 2k). Show G=(V,E) has (  ) an Euler circuit. n Step 3d: PATCH C’ to C to form C’’: v C: v vC’: u = (i) Start at v (ii) Follow C to u C’’: v v (iii) Follow C’ from u all the way back to u (iv) Return from u through untravelled portion of C to v Proof: (The algorithm)

Euler Circuit Theorem (Proof  ) Proof (  ): Assume (1) G is connected, (2) (  v  V, deg(v) = 2k). Show G=(V,E) has (  ) an Euler circuit. n Let C = C’’. Go back to Step 3: v C : v v Proof: (The algorithm)

Euler Circuit Theorem (Proof  ) Proof (  ): Assume (1) G is connected, (2) (  v  V, deg(v) = 2k). Show G=(V,E) has (  ) an Euler circuit. n Step 3: Does C contain every edge and vertex of G? n If ‘Yes’, then stop and output C, which is an Euler circuit. n If ‘No’… (3a-3d) v C : v v Proof: (The algorithm)

Euler Circuit Theorem (Proof  ) The algorithm: Step 1: Pick any vertex v  V as the starting vertex. n Step 2: Pick any sequence of adjacent vertices and edges starting and ending at v, and never repeating an edge. Let this circuit be C. n Step 3: Does C contain every edge and vertex of G? If ‘Yes’, then stop and output C, which is an Euler circuit. If ‘No’, then… –Step 3a: Remove the circuit C from G creating G’. –Step 3b: Pick any vertex u common to C and G’ –Step 3c: Pick any sequence of adjacent vertices and edges of G’, starting and ending at u, never repeating an edge, creating another circuit C’. –Step 3d: PATCH C’ to C to form C’’: Start at v Follow C to u Follow C’ from u all the way back to u Return from u through untravelled portion of C to v Let C = C’’. Go to Step 3.

Euler Circuit Theorem (Proof  ) Proof (  ): Assume (1) G is connected, (2) (  v  V, deg(v) = 2k). Show G=(V,E) has (  ) an Euler circuit. Proof: (1)IF the algorithm terminates, THEN it will give an Euler circuit. This is true because Step 3 checks whether all edges have been used, and step 3a ensures that no edge is repeated in the circuit. n Step 3: Does C contain every edge and vertex of G? If ‘Yes’, then stop and output C, which is an Euler circuit. If ‘No’, then… –Step 3a: Remove the circuit C from G creating G’. –Step 3b: Pick any vertex u common to C and G’ –Step 3c: Create another ciruit C’ startin from u. –Step 3d: PATCH C’ to C to form C’’:

Euler Circuit Theorem (Proof  ) Proof (  ): Assume (1) G is connected, (2) (  v  V, deg(v) = 2k). Show G=(V,E) has (  ) an Euler circuit. Proof: (2)The algorithm will always terminate, because… (a) The graph is finite, (b) Step 3b will always be successful since the graph is connected, any remaining edges must connect to the currently found circuit. (c) Step 2 and 3c will always be successful – a new circuit can always be found since the degree of the vertex u is even. n Step 3: Does C contain every edge and vertex of G? If ‘Yes’, then stop and output C, which is an Euler circuit. If ‘No’, then… –Step 3a: Remove the circuit C from G creating G’. –Step 3b: Pick any vertex u common to C and G’ –Step 3c: Create another circuit C’ starting from u –Step 3d: PATCH C’ to C to form C’’:

Example n (Euler Circuit Theorem): Let G=(V,E) be a graph. G has an Euler circuit iff G is connected AND every vertex of G has even degree. Q: Does the graph have an Euler circuit A: Yes a b c d e f g h j i VertexDegree a2a2 b2b2 c2c2 d4d4 e4e4 f2f2 g2g2 h4h4 i2i2 j2j2 Even

Example n (Euler Circuit Theorem): Let G=(V,E) be a graph. G has an Euler circuit iff G is connected AND every vertex of G has even degree. Q: Does the graph have an Euler circuit A: Yes a b c d e f g h j i Q: Where is the Circuit?

Example n (Euler Circuit Theorem): Let G=(V,E) be a graph. G has an Euler circuit iff G is connected AND every vertex of G has even degree. Q: Does the graph have an Euler circuit A: Yes a b c d e f g h j i Q: Where is the Circuit? C = a b c d a

Example n (Euler Circuit Theorem): Let G=(V,E) be a graph. G has an Euler circuit iff G is connected AND every vertex of G has even degree. Q: Does the graph have an Euler circuit A: Yes a b c d e f g h j i Q: Where is the Circuit? C = a b c d a C’ = d e g h j i d C’’ = a b c d e g h j i d a

Example n (Euler Circuit Theorem): Let G=(V,E) be a graph. G has an Euler circuit iff G is connected AND every vertex of G has even degree. Q: Does the graph have an Euler circuit A: Yes a b c d e f g h j i Q: Where is the Circuit? C = a b c d e g h j i d a

Example n (Euler Circuit Theorem): Let G=(V,E) be a graph. G has an Euler circuit iff G is connected AND every vertex of G has even degree. Q: Does the graph have an Euler circuit A: Yes a b c d e f g h j i Q: Where is the Circuit? C = a b c d e g h j i d a C’ = e f h e C’’ = a b c d e f h e g h j i d a

Example n (Euler Circuit Theorem): Let G=(V,E) be a graph. G has an Euler circuit iff G is connected AND every vertex of G has even degree. Q: Does the graph have an Euler circuit A: Yes a b c d e f g h j i Q: Where is the Circuit? C = a b c d e f h e g h j i d a C is the Euler Circuit

Example n (Euler Circuit Theorem): Let G=(V,E) be a graph. G has an Euler circuit iff G is connected AND every vertex of G has even degree. Q: Does the graph have an Euler circuit A: No.

Euler Path (Definition) n Definition: Let G=(V,E) be a graph. An EULER PATH from v to u (v  u) for G is a simple path starting from v and ending at u and contains every edge in E. n Implications: –‘simple path’: edges must be distinct… At most 1 traversal of each edge. –‘every edge in E’: … At least 1 traversal of each edge.

Euler Path Theorem n (Euler Path Theorem): Let G=(V,E) be a graph. G has an Euler Path from v to u iff G is connected AND v and u have odd degree and every other vertex of G has even degree. n Euler Path theorem is a COROLLARY (a consequence, a result) of Euler Circuit theorem. n Proof is left as an exercise (You need to use the Euler circuit theorem to prove the Euler Path theorem).

Euler Path Theorem (Example) n (Euler Path Theorem): Let G=(V,E) be a graph. G has an Euler Path from v to u iff G is connected AND v and u have odd degree and every other vertex of G has even degree. Q: Does the graph have an Euler path from a to d? A: Yes. Degree a and d are odd. All other degree are even. a b cd ef gh j i k Q: Where is the Path?

Euler Path Theorem (Example) n (Euler Path Theorem): Let G=(V,E) be a graph. G has an Euler Path from v to u iff G is connected AND v and u have odd degree and every other vertex of G has even degree. a b cd ef gh j i Q: Does the graph have an Euler path from a to d? A: Yes. Degree a and d are odd. All other degree are even. k Q: Where is the Path? A: a g h i e h f a

Euler Path Theorem (Example) n (Euler Path Theorem): Let G=(V,E) be a graph. G has an Euler Path from v to u iff G is connected AND v and u have odd degree and every other vertex of G has even degree. a b cd ef gh j i Q: Does the graph have an Euler path from a to d? A: Yes. Degree a and d are odd. All other degree are even. k Q: Where is the Path? A: a g h i e h f ab f e k j d b c d

Hamiltonian Circuit (Definition) n Definition: Let G=(V,E) be a graph (simple or multigraph). A HAMILTONIAN CIRCUIT for G is a elementary circuit that contains every vertex in V. (Sir William Hamilton , Irish) n Implications: –‘elementary circuit’: vertices must be distinct… –AT MOST ONE traversal of each vertex –‘every vertex in V’: … –AT LEAST ONE traversal of each vertex –‘elementary circuit’: (edges distinct of course!)

Hamiltonian Circuit (Examples) g b d a f e c h Q: Is there a Hamiltonian circuit? gbdafhecg A: Yes

Hamiltonian Circuit (Theorem?) n Q: Given ANY graph G=(V,E), is there a ‘nice property’ which is a sufficient condition to determine whether the graph has a Hamiltonian circuit? (Sufficient condition:) Property  Hamiltonian Circuit n A: Don’t know. No choice but to try all possible ways. n Q: Are there special types of graphs which definitely have Hamiltonian circuits? n A: Yes. n Q: What are they? n A: Graphs of some forms of geometric solids. (i) Platonic Solids; (ii) Archimedian solids

Hamiltonian Circuit (Special Cases) (i) Platonic Solids:

Hamiltonian Circuit (Special Cases) (ii) Archidemian Solids:

Hamiltonian Path (Definition) n Definition: Let G=(V,E) be a graph. A HAMILTONIAN Path for G is a elementary path that contains every vertex in V. n Implications: –‘elementary path’: vertices must be distinct… –AT MOST ONE traversal of each vertex –‘every vertex in V’: … –AT LEAST ONE traversal of each vertex –‘Simple path’: (edges distinct of course!)

Hamiltonian Path (Example) n Example: The following graph does not have a Hamiltonian circuit. g b d a f e c h Q: But does it have a Hamiltonian Path from a to c? A: Yes: a e h f d b g c

Hamiltonian Path (Example) n Example: The following graph does not have a Hamiltonian circuit. g b d a f e c h Q: Does it have a Hamiltonian Path from a to g? A: No.

Hamiltonian Path (Example) n Example: The following graph does not have a Hamiltonian circuit. g b d a f e c h Q: Can there be Hamiltonian Paths starting from g? A: No.

Hamiltonian Path (Example) n Example: The following graph does not have a Hamiltonian circuit. g b d a f e c h Q: Can there be Hamiltonian Paths ending at d? A: No.

Hamiltonian Path (Example) n Example: The following graph does not have a Hamiltonian circuit. g b d a f e c h Q: Can there be a Hamiltonian Path ending at ‘a’? A: Yes. Example: b g c d f e h

Hamiltonian Path (Theorem) n Q: Given ANY graph G=(V,E), is there a ‘nice property’ which is a sufficient condition to determine whether the graph has a Hamiltonian path? (Sufficient condition:) Property  Hamiltonian Path n Notes: (Sufficient condition:) Property  Hamiltonian Path (Necessary condition:) Property ← Hamiltonian Path (Sufficient and necessary condition:) Property ↔ Hamiltonian Path

Hamiltonian Path (theorem) Q: Given ANY graph G=(V,E), is there a ‘nice property’ which is a sufficient condition to determine whether the graph has a Hamiltonian path? (Sufficient condition:) Property → Hamiltonian Path Please note that this does not mean that ~ Property → ~Hamiltonian Path Yes there is, but only for simple graph: Sufficient condition for a simple graph G with n vertices to have Hamiltonian Path is every pair of vertices must have ….