1.5.5 Hamiltonian Cycle

INPUT OUTPUT

Input Description:
A graph G = (V,E).

Problem:
Find an ordering of the vertices such that each vertex
is visited exactly once.

Excerpt from
The Algorithm Design Manual:
The problem of finding a Hamiltonian cycle or path in a graph
is a special case of the traveling salesman problem, one where
each pair of vertices with an edge between them has
distance 1, while nonedge vertex pairs are separated by distance infinity.

Closely related is the problem of finding the longest path or cycle in a
graph, which occasionally arises in pattern recognition problems. Let the vertices in the graph correspond to
possible symbols, and let edges link symbols that can possibly be next to each other.
The longest path through this graph is likely the correct interpretation.