# Hamiltonian path

(Redirected from Hamiltonian graph)
One possible Hamiltonian cycle through every vertex of a dodecahedron is shown in red – like all platonic solids, the dodecahedron is Hamiltonian
The above as a two-dimensional planar graph
The Herschel graph is the smallest possible polyhedral graph that does not have a Hamiltonian cycle. A possible Hamiltonian path is shown.

In the mathematical field of graph theory, a Hamiltonian path (or traceable path) is a path in an undirected or directed graph that visits each vertex exactly once. A Hamiltonian cycle (or Hamiltonian circuit) is a Hamiltonian path that is a cycle. Determining whether such paths and cycles exist in graphs is the Hamiltonian path problem, which is NP-complete.

Hamiltonian paths and cycles are named after William Rowan Hamilton who invented the icosian game, now also known as Hamilton's puzzle, which involves finding a Hamiltonian cycle in the edge graph of the dodecahedron. Hamilton solved this problem using the icosian calculus, an algebraic structure based on roots of unity with many similarities to the quaternions (also invented by Hamilton). This solution does not generalize to arbitrary graphs.

Despite being named after Hamilton, Hamiltonian cycles in polyhedra had also been studied a year earlier by Thomas Kirkman, who, in particular, gave an example of a polyhedron without Hamiltonian cycles.[1] Even earlier, Hamiltonian cycles and paths in the knight's graph of the chessboard, the knight's tour, had been studied in the 9th century in Indian mathematics by Rudrata, and around the same time in Islamic mathematics by al-Adli ar-Rumi [fr]. In 18th century Europe, knight's tours were published by Abraham de Moivre and Leonhard Euler.[2]

## Definitions

A Hamiltonian path or traceable path is a path that visits each vertex of the graph exactly once. A graph that contains a Hamiltonian path is called a traceable graph. A graph is Hamiltonian-connected if for every pair of vertices there is a Hamiltonian path between the two vertices.

A Hamiltonian cycle, Hamiltonian circuit, vertex tour or graph cycle is a cycle that visits each vertex exactly once. A graph that contains a Hamiltonian cycle is called a Hamiltonian graph.

Similar notions may be defined for directed graphs, where each edge (arc) of a path or cycle can only be traced in a single direction (i.e., the vertices are connected with arrows and the edges traced "tail-to-head").

A Hamiltonian decomposition is an edge decomposition of a graph into Hamiltonian circuits.

A Hamilton maze is a type of logic puzzle in which the goal is to find the unique Hamiltonian cycle in a given graph.[3][4]

## Properties

Any Hamiltonian cycle can be converted to a Hamiltonian path by removing one of its edges, but a Hamiltonian path can be extended to Hamiltonian cycle only if its endpoints are adjacent.

All Hamiltonian graphs are biconnected, but a biconnected graph need not be Hamiltonian (see, for example, the Petersen graph).[6]

An Eulerian graph G (a connected graph in which every vertex has even degree) necessarily has an Euler tour, a closed walk passing through each edge of G exactly once. This tour corresponds to a Hamiltonian cycle in the line graph L(G), so the line graph of every Eulerian graph is Hamiltonian. Line graphs may have other Hamiltonian cycles that do not correspond to Euler tours, and in particular the line graph L(G) of every Hamiltonian graph G is itself Hamiltonian, regardless of whether the graph G is Eulerian.[7]

A tournament (with more than two vertices) is Hamiltonian if and only if it is strongly connected.

The number of different Hamiltonian cycles in a complete undirected graph on n vertices is (n − 1)! / 2 and in a complete directed graph on n vertices is (n − 1)!. These counts assume that cycles that are the same apart from their starting point are not counted separately.

## Bondy–Chvátal theorem

The best vertex degree characterization of Hamiltonian graphs was provided in 1972 by the BondyChvátal theorem, which generalizes earlier results by G. A. Dirac (1952) and Øystein Ore. Both Dirac's and Ore's theorems can also be derived from Pósa's theorem (1962). Hamiltonicity has been widely studied with relation to various parameters such as graph density, toughness, forbidden subgraphs and distance among other parameters.[8] Dirac and Ore's theorems basically state that a graph is Hamiltonian if it has enough edges.

Bondy–Chvátal theorem (1976)

A graph is Hamiltonian if and only if its closure is Hamiltonian.

As complete graphs are Hamiltonian, all graphs whose closure is complete are Hamiltonian, which is the content of the following earlier theorems by Dirac and Ore.

Dirac (1952)

A simple graph with n vertices (n ≥ 3) is Hamiltonian if every vertex has degree n / 2 or greater.

Ore (1960)

A simple graph with n vertices (n ≥ 3) is Hamiltonian if, for every pair of non-adjacent vertices, the sum of their degrees is n or greater (see Ore's theorem).

The following theorems can be regarded as directed versions:

Ghouila-Houiri (1960)

A strongly connected simple directed graph with n vertices is Hamiltonian if every vertex has a full degree greater than or equal to n.

Meyniel (1973)

A strongly connected simple directed graph with n vertices is Hamiltonian if the sum of full degrees of every pair of distinct non-adjacent vertices is greater than or equal to 2n − 1.

The number of vertices must be doubled because each undirected edge corresponds to two directed arcs and thus the degree of a vertex in the directed graph is twice the degree in the undirected graph.

A simple graph with n vertices has a Hamiltonian path if, for every non-adjacent vertex pairs the sum of their degrees and their shortest path length is greater than n.[9]

The above theorem can only recognize the existence of a Hamiltonian path in a graph and not a Hamiltonian Cycle.

Many of these results have analogues for balanced bipartite graphs, in which the vertex degrees are compared to the number of vertices on a single side of the bipartition rather than the number of vertices in the whole graph.[10]

A useful option for determining the existence of a Hamiltonian cycle in a directed graph is using the Hamiltonian cycle polynomial of an n×n-matrix ${\displaystyle A}$  defined as ${\displaystyle \operatorname {ham} (A)=\sum _{\sigma \in H_{n}}\prod _{i=1}^{n}a_{i,\sigma (i)}}$  where ${\displaystyle {H_{n}}}$  is the set of n-permutations having only one cycle. In (Knezevic & Cohen (2017)) it was shown that ${\displaystyle \operatorname {ham} (A)=\Sigma _{J\subseteq \{2,\dots ,n\}}\det(A_{J})\operatorname {per} (A_{\bar {J}})(-1)^{|J|}}$  where ${\displaystyle A_{J}}$  is the submatrix of ${\displaystyle A}$  induced by the rows and columns of ${\displaystyle A}$  indexed by ${\displaystyle J}$ , and ${\displaystyle {\bar {J}}}$  is the complement of ${\displaystyle J}$  in ${\displaystyle \{1,\dots ,n\}}$ , while the determinant of the empty submatrix is defined to be 1. In characteristic 2 the latter equality turns into ${\displaystyle \operatorname {ham} (A)=\Sigma _{J\subseteq \{2,\dots ,n\}}\det(A_{J})\operatorname {det} (A_{\bar {J}})}$  what therefore provides an opportunity to polynomial-time calculate the Hamiltonian cycle polynomial of any unitary matrix ${\displaystyle U}$  (i.e. such that ${\displaystyle U^{T}U=I}$  where ${\displaystyle I}$  is the identity n×n-matrix), because each minor of such a matrix coincides with its algebraic complement: ${\displaystyle \operatorname {ham} (U)=\operatorname {det} ^{2}(U+I_{/1})}$  where ${\displaystyle I_{/1}}$  is the identity n×n-matrix with the entry of indexes 1,1 replaced by 0. Hence if it's possible to assign weights from a field of characteristic 2 to a digraph's arcs that make its weighted adjacency matrix unitary and the Hamiltonian cycle polynomial of this matrix is non-zero then the digraph is Hamiltonian.

## Existence of Hamiltonian cycles in planar graphs

Theorem (Whitney, 1931)
A 4-connected planar triangulation has a Hamiltonian cycle.
Theorem (Tutte, 1956)
A 4-connected planar graph has a Hamiltonian cycle.

## Notes

1. ^ Biggs, N. L. (1981), "T. P. Kirkman, mathematician", The Bulletin of the London Mathematical Society, 13 (2): 97–120, doi:10.1112/blms/13.2.97, MR 0608093.
2. ^ Watkins, John J. (2004), "Chapter 2: Knight's Tours", Across the Board: The Mathematics of Chessboard Problems, Princeton University Press, pp. 25–38, ISBN 978-0-691-15498-5.
3. ^ de Ruiter, Johan (2017). Hamilton Mazes - The Beginner's Guide.
4. ^ Friedman, Erich (2009). "Hamiltonian Mazes". Erich's Puzzle Palace. Archived from the original on 16 April 2016. Retrieved 27 May 2017.
5. ^ Gardner, M. "Mathematical Games: About the Remarkable Similarity between the Icosian Game and the Towers of Hanoi." Sci. Amer. 196, 150–156, May 1957
6. ^ Eric Weinstein. "Biconnected Graph". Wolfram MathWorld.
7. ^ Balakrishnan, R.; Ranganathan, K. (2012), "Corollary 6.5.5", A Textbook of Graph Theory, Springer, p. 134, ISBN 9781461445296.
8. ^ Gould, Ronald J. (July 8, 2002). "Advances on the Hamiltonian Problem - A Survey" (PDF). Emory University. Retrieved 2012-12-10.
9. ^ Rahman, M. S.; Kaykobad, M. (April 2005). "On Hamiltonian cycles and Hamiltonian paths". Information Processing Letters. 94: 37–41. doi:10.1016/j.ipl.2004.12.002.
10. ^ Moon, J.; Moser, L. (1963), "On Hamiltonian bipartite graphs", Israel Journal of Mathematics, 1: 163–165, doi:10.1007/BF02759704, MR 0161332