You are on page 1of 11

A Hamiltonian graph, also called a Hamilton graph, is a graph possessing a Hamiltonian

cycle. A graph that is not Hamiltonian is said to be non hamiltonian.

A Hamiltonian graph on nodes has graph circumference.

While it would be easy to make a general definition of "Hamiltonian" that goes either way
as far as the singleton graph is concerned, defining "Hamiltonian" to mean "has a
Hamiltonian cycle" and taking "Hamiltonian cycles" to be a subset of "cycles" in general
would lead to the convention that the singleton graph is non hamiltonian (B. McKay, pers.
com, Oct. 11, 2006). However, by convention, the singleton graph is generally considered
to be Hamiltonian (B. McKay, pers. comm., Mar. 22, 2007). The convention in this work
and in GraphData is that is Hamiltonian, while is non hamiltonian.

The numbers of simple Hamiltonian graphs on nodes for n=1, 2, ... are then given by 1,
0, 1, 3, 8, 48, 383, 6196, 177083, ... (OEIS A003216).

Testing whether a graph is Hamiltonian is an NP-complete problem (Skiena 1990,


p. 196). Rubin (1974) describes an efficient search procedure that can find some or all
Hamilton paths and circuits in a graph using deductions that greatly reduce backtracking
and guesswork.

All Hamiltonian graphs are biconnected, although the converse is not true (Skiena 1990,
p. 197). Any bipartite graph with unbalanced vertex parity is not Hamiltonian.

If the sums of the degrees of nonadjacent vertices in a graph is greater than the number
of nodes for all subsets of nonadjacent vertices, then is Hamiltonian (Ore 1960;
Skiena 1990, p. 197).

All planar 4-connected graphs have Hamiltonian cycles, but not all polyhedral graphs do.
For example, the smallest polyhedral graph that is not Hamiltonian is the Herschel
graph on 11 nodes.

All Platonic solids are Hamiltonian (Gardner 1957), as illustrated above.


Although not explicitly stated by Gardner (1957), all Archimedean solids have
Hamiltonian circuits as well, several of which are illustrated above. However, the
skeletons of the Archimedean duals (i.e, the Archimedean dual graphs are not
necessarily Hamiltonian, as shown by Coxeter (1946) and Rosenthal (1946) for
the rhombic dodecahedron (Gardner 1984, p. 98).

Through a graph that visits each node exactly once (Skiena 1990, p. 196). A graph
possessing a Hamiltonian cycle is said to be a Hamiltonian graph. By convention,
the singleton graph is considered to be Hamiltonian even though it does not poses a
Hamiltonian cycle, while the connected graph on two nodes is not.

The Hamiltonian cycle is named after Sir William Rowan Hamilton, who devised a puzzle
in which such a path along the polyhedron edges of an dodecahedron was sought
(the Icosian game).

A Hamiltonian cycle of a graph can be computed efficiently in the Wolfram


Language using Find Hamiltonian Cycle [All, All, 1] [1] (where the cycle returned is not
necessarily the lexicographically first one). All simple (undirected) cycles of a graph can
be computed time-efficiently (but with a memory overhead of more than 10 times that
needed to represent the actual cycles) using Sort Find Hamiltonian Cycle [g, Al] [All, All,
1]. (Note the cycles returned are not necessarily returned in sorted order by default.)

Possible Method options include "Backtrack", "Heuristic", "AngluinValiant", "Martello",


and "MultiPath". In addition, the Wolfram Language command Find Shortest Tour
attempts to find a shortest tour, which is a Hamiltonian cycle (with initial vertex repeated
at the end) for a Hamiltonian graph if it returns a list with first element equal to the vertex
count of .

Precomputed lists of Hamiltonian cycles for many named graphs can be obtained
using Graph Data [graph, "Hamiltonian Cycles"]. Precomputed counts of the
corresponding number of Hamiltonian cycles may similarly be obtained using Graph Data
[graph, "Hamiltonian Cycle Count"].

The total numbers of directed Hamiltonian cycles for all simple graphs of orders , 2,
... are 0, 0, 2, 10, 58, 616, 9932, 333386, 25153932, 4548577688, ... (OEIS A124964).

In general, the problem of finding a Hamiltonian cycle is NP-complete (Karp 1972; Garey
and Johnson 1983, p. 199), so the only known way to determine whether a given
general graph has a Hamiltonian cycle is to undertake an exhaustive search. Rubin
(1974) describes an efficient search procedure that can find some or all Hamilton paths
and circuits in a graph using deductions that greatly reduce backtracking and guesswork.
A probabilistic algorithm due to Angluin and Valiant (1979), described by Wilf (1994), can
also be useful to find Hamiltonian cycles and paths.

All Platonic solids are Hamiltonian (Gardner 1957), as illustrated above.

Khomenko and Golovko (1972) gave a formula giving the number of graph cycles of any
length, but its computation requires computing and performing matrix operations involving
all subsets up to size , making it computationally expensive. A greatly simplified and
improved version of the Khomenko and Golovko formula for the special case of -cycles
(i.e., Hamiltonian cycles) gives

where is the th matrix power of the submatrix of the adjacency matrix with the
subset of rows and columns deleted (Perepechko and Voropaev).

The following table summarizes the numbers of (undirected) Hamiltonian cycles on


various classes of graphs. The -hypercube is considered by Gardner (1986, pp. 23-24),
who however gives the counts for an -hypercube for , 2, ... as 2, 8, 96, 43008, ...
(OEIS A006069) which must be divided by to get the number of distinct (directed)
cycles counting shifts of points as equivalent regardless of starting vertex.

Graph Sloane Sequence


Andrásfai graph A143249 0, 1, 5, 145, 8697, 1109389, 236702901, ...
X, X, 16, 29, 56, 110, 225, 469, 991, 2110, 4511,
Antiprism graph A124353
...
X, X, 0, 4, 704, 553008, , 13802629632,
-black bishop graph A282889
1782158930138112, ...
Cocktail party graph A129348 0, 1, 16, 744, 56256, ...
Complete bipartite
A143248 0, 1, 6, 72, 1440, 43200, 1814400, ...
graph
Complete tripartite
A141147 1, 16, 1584, 463104, 29928960, ...
graph
Complete graph A124355 0, 0, 1, 3, 12, 60, 360, 2520, 20160, 181440, ...
-crossed prism graph A007283 X, X, X, 6, 12, 24, 48, 96, 192, 384, 768, 1536, ...
1, 6, 156, 4800, 208440, 11939760, 874681920,
Crown graph A094047
...
Cube-connected cycle A000000 X, X, 6, 28628, ...
Cycle graph A007395 X, X, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
Folded cube graph A280847 X, 0, 3, 72, 23760, 332012113920, ...
Grid graph A143246 0, 1, 0, 6, 0, 1072, 0, 4638576, 0, ...
Grid graph A000000 0, 6, 0, ?, 0, ...
0, 0, 3, 744, 986959440,
Halved cube graph A281255
312829871511322359060480, ...
Hypercube graph A003042 0, 1, 6, 1344, 906545760, ...
-king graph A140521 X, 3, 16, 2830, 2462064, 22853860116, ...
-knight graph A000000 X, 0, 0, 0, 0, 9862, 0, 13267364410532, ...
-ladder graph A000000 0, 1, 1, 1, 1, 1, 1, ...
Möbius ladder A124356 X, X, X, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 16, 15, ...
Mycielski graph A143247 0, 1, 10, 102310, ...
Odd graph A301557 X, 1, 0, 1419264, ...
Permutation star graph A000000 0, 0, 1, 18, ...
Prism graph A124349 X, X, 3, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 16, ...
-queen graph A158663 0, 3, 1960, 402364270, 39741746126749664, ...
Rook graph A000000 X, 1, 48, 284112, 167875338240, ...
Sun graph A000000 X, X, 1, 1, 1, 1, 1, 1, ...
Sunlet graph A000000 X, X, 0, 0, 0, 0, 0, 0, ...
Torus grid graph A000000 X, X, 48, 1344, 23580, 3273360, ...
Transposition graph A000000 0, 0, 6, 569868288, ...
Triangular graph A129349 X, 0, 1, 16, 3216, 9748992, ...
Triangular grid graph A174589 1, 1, 3, 26, 474, 17214, 685727, ...
Web graph A000000 X, X, 0, 0, 0, 0, 0, ...
Wheel graph A005843 X, X, X, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ...
X, X, 1, 4, 396, 553008, 4701600128,
-white bishop graph A282890
1782158930138112

Closed forms for some of these classes of graphs are summarized in the following
table, where , , and are the roots of and is a modified Bessel
function of the second kind.

Graph Formula
Antiprism graph

Cocktail party graph

Complete graph

Complete bipartite graph

Complete tripartite graph

-crossed prism graph

Crown graph

Cycle graph 1
Hanoi graph 1
Ladder graph 1
Möbius ladder
Prism graph
Sun graph 1
Wheel graph
Hamilonian Path – A simple path in a graph that passes through every vertex exactly
once is called a Hamiltonian path.

Hamilonian Circuit – A simple circuit in a graph that passes through every vertex exactly
once is called a Hamiltonian circuit.

Unlike Euler paths and circuits, there is no simple necessary and sufficient criteria to
determine if there are any Hamiltonian paths or circuits in a graph. But there are certain
criteria which rule out the existence of a Hamiltonian circuit in a graph, such as- if there
is a vertex of degree one in a graph then it is impossible for it to have a Hamiltonian circuit.

There are certain theorems which give sufficient but not necessary conditions for the
existence of Hamiltonian graphs.
Dirac’s Theorem- “If is a simple graph with vertices with such that the degree of
eververtex in is at least then has a Hamiltonian circuit.”

Ore’s Theorem- “If is a simple graph with vertices with such that for every pair of non-
adjacent vertices and in, then has a Hamiltonian circuit.”

As mentioned above that the above theorems are sufficient but not necessary conditions
for the existence of a Hamiltonian circuit in a graph, there are certain graphs which have
a Hamiltonian circuit but do not follow the conditions in the above-mentioned theorem.
For example, the cycle has a Hamiltonian circuit but does not follow the theorems.
There are many practical problems which can be solved by finding the optimal
Hamiltonian circuit. One such problem is the Travelling Salesman Problem which asks
for the shortest route through a set of cities.
 Example 1- Does the following graph have a Hamiltonian Circuit?
 Solution- Yes, the above graph has a Hamiltonian circuit. The solution is –

 Example 2- Does the following graph have a Hamiltonian Circuit?

 Solution- No the above graph does not have a Hamiltonian circuit as there are
two vertices with degree one in the graph.

An Hamiltonian path on a graph is a path going through every vertex of the graph once
only.

An Hamiltonien circuit or tour is a circuit (closed path) going through every vertex of the
grap.

A graph is said to be Hamiltonian if there is an Hamiltonian circuit on it.


This name comes from a game imagined by Sir W. Hamilton in 1859 : A traveller wants
to visit 20 towns on the vertices of a dodecahedron, going once at every town and
returning.

The dodecahedron could be "flatened" on the following graph.


There are a lot of solutions, but they all reduce to only one by symetries : The Hamiltonian
circuit cuts the dodecahedron in two identical parts build of 6 connected pentagons One
of them build the "inner" part of the Hamiltonian circuit, the other is the "outer" part on the
planad.

They can be glued end to end to build an Hamiltonian circuit on the dual graph
(icosahedron).
Not every graph is Hamiltonian : An Hamiltonian graph must be 2-connected, that is we
have to delete at least 2 vertices to split the graph in two disconnected parts.
This is not enough, as shown by this smallest 2-connected non Hamiltonian graph.
Note also that we take care only of simple graphs (without loops and no more than one
arc between two vertices). The loops can be deleted as coming back to the vertex we
have just visited. The double arcs also are useless and can be deleted. We'll assume in
the sequel that all graphs are simple and connected graphs.
There are other necessary conditions for a graph to be Hamiltonian.
There are also some sufficient conditions. We don't know any general necessary and
sufficient condition.
For example, let's look at the following graphs (some of which were observed in earlier
pages) and determine if they're Hamiltonian.

Graph Type Graph Hamiltonian or Not?

Hamiltonian. Notice that a cycle can


Complete
easy be formed since all vertices xi are
Graph K5
connected to all other vertices in V(G).

Complete
Hamiltonian. Same case as above.
Graph K6
Complete
Bipartite Not Hamiltonian.
Graph K2,3

Hamiltonian. Recall that a cycle of a


complete bipartite graph uses the same
Complete number of vertices from vertex set A and
Bipartite vertex set B. If we want to consider
Graph K3,3 Hamiltonian graphs for complete bipartite
graphs, then if V(G)=A∪B and A∩B=∅,
then | A | = | B |.

Not Hamiltonian. This should be rather


Disconnected
obvious since a cycle cannot be formed
Graph
containing all vertices of the graph!

Not Hamiltonian. The degree of all


vertices in a cycle is 2, but the degree of
Graphs with
vertex x1that is considered a leaf by
Leaves
definition has deg(x1)=1. Thus a cycle
cannot be formed.
Hamiltonian. In fact, Q for all k is
Cube Graph Q3
Hamiltonian. (See Gray Codes)

Hamiltonian. It should be obvious that a


cycle graph in itself contains a
Cycle Graph C6
Hamiltonian cycle. In fact, the graph is a
Hamiltonian cycle.

Platonic Solid: Hamiltonian. All platonic solids are


Octahedron Hamiltonian.

You might also like