Britannica Sources used in this answer

What condition allows a graph to have a path that uses every edge exactly once?

Created from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles.

In graph theory, a path that traverses every edge exactly once is known as an Eulerian path. For such a path to exist in a connected graph, the condition is that the graph must have either zero or exactly two vertices of odd degree.1

If a graph has zero vertices of odd degree, it contains an Eulerian circuit, meaning the path begins and ends at the same vertex. If a graph has exactly two vertices of odd degree, an Eulerian path exists that starts at one of the odd-degree vertices and ends at the other. This principle was famously established by Leonhard Euler while solving the Königsberg bridge problem, marking the origin of this field of mathematics.1