A Hamiltonian Cycle is a path in a graph that visits every node exactly once and returns to the starting node. It is closely related to Travelling Salesman Problem, where the goal is to find the shortest possible Hamiltonian cycle. Hamiltonian cycles are useful in routing, scheduling, and circuit design.
An Eulerian Path visits every EDGE in the graph exactly once (solvable in O(E) time). A Hamiltonian Path visits every VERTEX in the graph exactly once (an NP-complete problem with no known polynomial-time solution).
The Hamiltonian Cycle problem asks if a cycle visiting every vertex once exists in an unweighted graph. TSP is the weighted optimization version: finding the Hamiltonian Cycle with the minimum total edge cost weight.
Sign in to join the discussion
Hand-picked resources to deepen your understanding
© 2025 See Algorithms. Code licensed under MIT, content under CC BY-NC 4.0