Hamiltonian Cycle Problem (HCP)
A Hamiltonian cycle (or Hamiltonian circuit) for a given graph G = (V, E) consists of finding an ordering of the vertices of G such that each vertex is visited exactly once and the last vertex returns to the first.
The problem is named after Sir William Rowan Hamilton, who in 1859 devised a puzzle — the icosian game — in which such a path along the edges of a dodecahedron was sought.
Deciding whether a graph contains a Hamiltonian cycle is NP-complete (Garey and Johnson, 1983), so no polynomial-time algorithm is known for the general case; in the worst case, only an exhaustive search can settle the question. The figures below show a graph and two of its Hamiltonian cycles.
The HCP is the decision problem at the heart of routing: the Traveling Salesman Problem asks for a minimum-cost Hamiltonian cycle in a weighted complete graph, and every VRP route is itself a Hamiltonian cycle over the depot plus the customers assigned to it.
See also: Traveling Salesman Problem · P and NP classes · VRP formulation