Skip to content

Euler Tour Algorithm

Definition

For a connected undirected Euler network, the course's Euler tour algorithm starts at a vertex ss, follows unused edges until returning to ss, and calls the resulting cycle Ω\Omega. If unused edges remain, choose a vertex vv on Ω\Omega incident to an unused edge, build another closed unused-edge traversal Ω1\Omega_1 from vv, and splice Ω1\Omega_1 into Ω\Omega at vv. Repeat until every edge is used.


Interpretation

The method builds a complete tour from smaller cycles: walk along unused edges until you are back at the start, then insert further closed detours at vertices already on the tour. Even degree ensures that every such detour can close at its starting vertex.

Two triangles sharing the start vertex A: a first cycle A, B, C, A, and a second cycle A, D, E, A inserted at A to complete the tour.

Starting at s=As=A, the first cycle Ω=A−B−C−A\Omega=A-B-C-A (blue edges 1 to 3) returns to AA but leaves A−DA-D, D−ED-E and E−AE-A unused. The second cycle A−D−E−AA-D-E-A (red edges 4 to 6) starts at AA, a vertex of Ω\Omega, and is spliced in there, giving A−B−C−A−D−E−AA-B-C-A-D-E-A, which uses all six edges.

A walk can only get stuck at its start. When it arrives at a vertex v≠sv\ne s, it has used an odd number of the edges at vv, two for each earlier pass and one for this arrival; since the degree of vv is even, an unused edge remains to leave by. A closed walk uses an even number of edges at every vertex, so after removing its edges all remaining degrees are still even and the next detour also closes. Connectedness ensures that, as long as unused edges remain, one of them touches a vertex already on the tour.

The algorithm thus proves the harder half of the Euler network characterization: even degrees suffice. It is also the final step of the Chinese postman problem, where each duplicated copy counts as a separate edge.


Key Results

  • Keep track of used edge identities, especially with parallel copies.
  • The splice inserts one closed excursion into another without losing any previously used edge.
  • Arbitrary eligible choices can give different valid Euler tours.

Examples

In the figure, the first cycle is Ω=A−B−C−A\Omega=A-B-C-A. The remaining cycle A−D−E−AA-D-E-A is spliced at AA, giving A−B−C−A−D−E−AA-B-C-A-D-E-A. The even-degree condition permits these closed excursions.

  • The worked example begins its first cycle at A.
  • It later adds a cycle through B and then one through D to include all 12 edges.

Prerequisites

Sources

Aliases: Hierholzer's algorithm Symbols: omega

Last updated: 20 October 2026 03:02