Computing Atlas

How Computing Was Built
Sign In
Text size
100%
Theme
Algorithm

Hierholzer's Algorithm

Graph Algorithm

Hierholzer's algorithm finds an Eulerian circuit, a closed walk that traverses every edge of a connected graph exactly once, in a graph where every vertex has an even degree. It works by starting at an arbitrary vertex and following unused edges until returning to that same starting vertex, forming an initial closed trail, then checking whether any vertex on that trail still has unused edges; where one does, the algorithm splices in a new closed trail beginning and ending at that vertex, merging it into the growing circuit, and repeats this splicing process until no unused edges remain. Carl Hierholzer worked out the method before his early death in 1871, and Christian Wiener arranged for the complete proof and description to be published posthumously in 1873. Implemented with an appropriate edge-tracking data structure, the algorithm runs in linear time in the number of edges, which makes it more efficient in the worst case than the older Fleury's algorithm for the same problem.

Facts
Time Complexity
Time Complexity (category)
Linear Time -- O(n) 1
Classification
Design Technique
Greedy 1
Connections

In Field

Source Eulerian path (Wikipedia)

Uses Design Technique

Entity-backed identity for the design-technique enum value this algorithm already carries, resolved to a computing concept by an explicit value-to-entity map (phase 3 bucket conversion, docs\design_entity_backed_browse_buckets_20260928.md). The design-technique fact itself stays on the algorithm unchanged.

Sources
1. Hierholzer's Algorithm (Wikipedia)
  • Wikipedia infobox: time complexity linear
    linear
  • Wikipedia: design technique greedy
    greedy
View the Source
Eulerian path (Wikipedia)
In Field: Algorithms and Complexity Theory, Lead paragraphView the Source
Comments (0)
No comments yet. Be the first to share a thought.
Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.