Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

A path in a graph that visits each vertex exactly once.

A Hamilton path (or Hamiltonian path) in a graph is a path that visits each vertex exactly once. Similarly, a Hamilton cycle in a graph is a cycle that visits each vertex exactly once.

We can talk about directed and undirected Hamilton paths/cycles, within directed and undirected graphs.

The Hamilton path problem, i.e., determining whether or not an input graph has a Hamilton path, is NP-Complete.

history | excerpt history