This is a search problem that looks for a path that uses each edge exactly once where the path can be open or closed (tours).

There exists a path iff:

  1. Every vertex with the possible exception of two vertices (start and end) have an even degree
  2. The graph is connected

Note

The origin of graph theory is this and the Bridges of Konigsberg

Degrees

Note that the degree of a vertex is the number of edges that connects it

If these conditions are satisfied we can find a path:
Fleury’s Algorithm (1883)

  1. Start at any vertex (or the one with odd degree if it exists)
  2. Traverse an edge whose deletion does not disconnect the graph, unless you have no choice
  3. Delete the traverse edge and repeat