11.3 hamiltonian paths and cycles - dr. travers page of...
TRANSCRIPT
![Page 1: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/1.jpg)
11.3 Hamiltonian Paths and Cycles
![Page 2: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/2.jpg)
The Icosian Game
The puzzleCan you determine a route along the edges of the graph that begins atsome vertex and then returns there after having visited every othervertex exactly once?
![Page 3: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/3.jpg)
Definitions
DefinitionA Hamiltonian path is a path that visits each vertex once.
DefinitionA Hamiltonian cycle (or circuit) is a closed path that visits each vertexonce.
DefinitionA graph that has a Hamiltonian cycle is called Hamiltonian.
![Page 4: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/4.jpg)
Definitions
DefinitionA Hamiltonian path is a path that visits each vertex once.
DefinitionA Hamiltonian cycle (or circuit) is a closed path that visits each vertexonce.
DefinitionA graph that has a Hamiltonian cycle is called Hamiltonian.
![Page 5: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/5.jpg)
Definitions
DefinitionA Hamiltonian path is a path that visits each vertex once.
DefinitionA Hamiltonian cycle (or circuit) is a closed path that visits each vertexonce.
DefinitionA graph that has a Hamiltonian cycle is called Hamiltonian.
![Page 6: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/6.jpg)
Which are Hamiltonian?
Of the following, which have Hamiltonian cycles? Hamiltonianpaths?
![Page 7: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/7.jpg)
Showing a Graph is Not Hamiltonian
Rules:
1 If a vertex v has degree 2, then both of its incident edges must bepart of any Hamiltonian cycle.
2 During the construction of a Hamiltonian cycle, no cycle can beformed until all of the vertices have been visited.
3 If during the construction of a Hamiltonian cycle two of theedges incident to a vertex v are required, then all other incidentedges can be deleted.
GoalTo begin a construction of a Hamiltonian cycle and show at somepoint during the construction that it is impossible to proceed anyfurther.
![Page 8: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/8.jpg)
Showing a Graph is Not Hamiltonian
Rules:
1 If a vertex v has degree 2, then both of its incident edges must bepart of any Hamiltonian cycle.
2 During the construction of a Hamiltonian cycle, no cycle can beformed until all of the vertices have been visited.
3 If during the construction of a Hamiltonian cycle two of theedges incident to a vertex v are required, then all other incidentedges can be deleted.
GoalTo begin a construction of a Hamiltonian cycle and show at somepoint during the construction that it is impossible to proceed anyfurther.
![Page 9: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/9.jpg)
Example
Is the given graph G Hamiltonian?
a• •b •c
v• •w •x
d• •e •f
![Page 10: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/10.jpg)
Solution
First apply rule 1 to vertices v,w and x
a• •b •c
v• •w •x
d• •e •f
![Page 11: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/11.jpg)
Solution (cont.)
Now apply rule 1 and 3 to vertex b
a• •b x •c
v• •w •x
d• •e •f
![Page 12: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/12.jpg)
Solution (cont.)
Now apply rule 3 to vertex a
a•x
•b x •c
v• •w •x
d• •e •f
Now, there is only one edge incident to c and by rule 1 noHamiltonian cycle can exist.
![Page 13: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/13.jpg)
Another Example
Is the following graph Hamiltonian?
a• b• •c
•v w•
d• e• •f
![Page 14: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/14.jpg)
Sufficiency Conditions
TheoremOre’s Theorem(1960) Suppose that G is a graph with n ≥ 3 verticesand for all distinct nonadjacent vertices x and y,
deg(x) + deg(y) ≥ n
The G has a Hamiltonian circuit.
Proof Suppose that G has no Hamiltonian circuit. We will show thatfor some nonadjacent vertices x, y ∈ V(G),
degG(x) + degG(y) < n (∗)
where degG(a) means the degree of a in G.
![Page 15: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/15.jpg)
Sufficiency Conditions
TheoremOre’s Theorem(1960) Suppose that G is a graph with n ≥ 3 verticesand for all distinct nonadjacent vertices x and y,
deg(x) + deg(y) ≥ n
The G has a Hamiltonian circuit.
Proof Suppose that G has no Hamiltonian circuit. We will show thatfor some nonadjacent vertices x, y ∈ V(G),
degG(x) + degG(y) < n (∗)
where degG(a) means the degree of a in G.
![Page 16: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/16.jpg)
Proof of Ore’s Theorem (cont.)
If we add edges to G, we eventually obtain a complete graph, whichhas a Hamiltonian circuit. Thus, in the process of adding edges, wemust eventually hit a graph H with the property that H has noHamiltonian circuit but adding any more edges to H gives us a graphwith a Hamiltonian circuit. We will show that in H, there arenonadjacent x and y so that
degH(x) + degH(y) < n (∗∗)
But degG(a) ≤ degH(a) for all a, so (∗∗) implies (∗).
Pick any nonadjacent vertices x and y in H. Then H plus the edge{x, y} has a Hamiltonian circuit. Since H does not, this circuit mustuse the edge {x, y}. Hence, it can be written as
x, y, a1, a2, . . . , an−2, x
![Page 17: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/17.jpg)
Proof of Ore’s Theorem (cont.)
If we add edges to G, we eventually obtain a complete graph, whichhas a Hamiltonian circuit. Thus, in the process of adding edges, wemust eventually hit a graph H with the property that H has noHamiltonian circuit but adding any more edges to H gives us a graphwith a Hamiltonian circuit. We will show that in H, there arenonadjacent x and y so that
degH(x) + degH(y) < n (∗∗)
But degG(a) ≤ degH(a) for all a, so (∗∗) implies (∗).
Pick any nonadjacent vertices x and y in H. Then H plus the edge{x, y} has a Hamiltonian circuit. Since H does not, this circuit mustuse the edge {x, y}. Hence, it can be written as
x, y, a1, a2, . . . , an−2, x
![Page 18: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/18.jpg)
Proof of Ore’s Theorem (cont.)
•y •a1 •a2 . . . •ai−1 •ai •ai+1 . . . •an−2 •x
Now, V(H) = {x, y, a1, a2, . . . , an−2}. Moreover, we note that fori > 1,
{y, ai} ∈ E(H)⇒ {x, ai−1} 6∈ E(H) (∗ ∗ ∗)For if not, then
y, ai, ai+1, . . . , an−2, x, ai−1, ai−2, . . . , a1, y
is a Hamiltonian circuit in H, which is a contradiction. So, (∗ ∗ ∗) and{x, y} 6∈ E(H) imply (∗∗).
•y •a1 •a2 . . . •ai−1 •ai •ai+1 . . . •an−2 •x
//
![Page 19: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/19.jpg)
Proof of Ore’s Theorem (cont.)
•y •a1 •a2 . . . •ai−1 •ai •ai+1 . . . •an−2 •x
Now, V(H) = {x, y, a1, a2, . . . , an−2}. Moreover, we note that fori > 1,
{y, ai} ∈ E(H)⇒ {x, ai−1} 6∈ E(H) (∗ ∗ ∗)For if not, then
y, ai, ai+1, . . . , an−2, x, ai−1, ai−2, . . . , a1, y
is a Hamiltonian circuit in H, which is a contradiction. So, (∗ ∗ ∗) and{x, y} 6∈ E(H) imply (∗∗).
•y •a1 •a2 . . . •ai−1 •ai •ai+1 . . . •an−2 •x
//
![Page 20: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/20.jpg)
Consequence
CorollaryDirac(1952) Suppose that G is a graph with n ≥ 3 vertices and eachvertex has degree at least n
2 . The G has a Hamiltonian circuit.
Why are we not proving this?
![Page 21: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/21.jpg)
Another Theorem
TheoremA connected graph of order n ≥ 3 with a bridge does not have aHamiltonian cycle.
The proof is in the text.
![Page 22: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/22.jpg)
Construction of a Hamiltonian Circuit
We will use this graph to illustrate the construction.
y1• •y2
y5• •y6
y4• •y3
![Page 23: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/23.jpg)
The Construction
Step 1Start with any vertex and construct the longest path you can.
γ : y1 − y2 − y3 − y4
y1• •y2
y5• •y6
y4• •y3
![Page 24: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/24.jpg)
Construction(cont.)
Step 2Check to see if y1 and ym are adjacent.a) If y1 and ym are not adjacent, go to (3). Else y1 and ym are adjacentand go to (b).b) If m = n, stop and the output is a Hamiltonian cycle.
γ : y1 − y2 − y3 − y4 − y1
c) Locate a vertex z not on γ and a vertex yk on γ such that z isadjacent to yk. Replace γ with a path of length m + 1 given by
z− yk − . . .− ym − y1 . . .− yk−1
and go back to (2).
![Page 25: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/25.jpg)
Construction(cont.)
y1• •y2
y5• •z
y4• •y3
γ : z− y3 − y4 − y1 − y2
Step 3Locate a vertex yk with 1 < k < m such that y1 and yk are adjacentand yk−1 and ym are adjacent. Replace γ with the path
γ : y1 − . . .− yk−1 − ym − . . .− yk
The two ends of the path, namely y1 and yk, are adjacent, and go backto (2)(b).
![Page 26: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/26.jpg)
Construction(cont.)
After renumbering, we now we return to (2)
y4• •y5
z• •y1
y3• •y2
z− y4 − y5 − y1 − y2 − y3
and then renumber
y2• •y3
y1• •y4
y6• •y5
![Page 27: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/27.jpg)
Construction(cont.)
After renumbering, we now we return to (2)
y4• •y5
z• •y1
y3• •y2
z− y4 − y5 − y1 − y2 − y3
and then renumber
y2• •y3
y1• •y4
y6• •y5
![Page 28: 11.3 Hamiltonian Paths and Cycles - Dr. Travers Page of Mathbtravers.weebly.com/.../11.3_hamiltonian_paths_slides.pdf · 2020. 2. 6. · Showing a Graph is Not Hamiltonian Rules:](https://reader035.vdocuments.us/reader035/viewer/2022071605/61414b4f6d7bf66e09136f39/html5/thumbnails/28.jpg)
Construction(cont.)
When we return to (2), we have the m = 6, so when we add the finaledge to return to start, we have completed the cycle.
y2• •y3
y1• •y4
y6• •y5