← Advanced Graphs · guided lesson

Advanced Graphs: Euler Paths, Bridges & SCCs

1 / 20 · story

the story

Euler paths and Hierholzer's algorithm

Every tool here exists because something was too slow or broke without it. Here is what.

1736; 1873 · Leonhard Euler; Carl Hierholzer (reconstructed by Christian Wiener)

Euler's Königsberg paper (1736 — see the Graphs chapter) gave the degree rule for walking every bridge once, but did not prove the rule was enough. Carl Hierholzer, a lecturer in Karlsruhe, found the proof and its method — walk until stuck, then splice in a loop from any vertex with unused edges — and presented it to fellow mathematicians. He died in September 1871 without writing it down. Christian Wiener reconstructed it from memory, with Jacob Lüroth's help, and published it in Mathematische Annalen in 1873. In 1883 Fleury published a slower rule: never cross a bridge of the unused edges unless you must. In 2001 Pevzner, Tang and Waterman's EULER assembler made Euler paths in de Bruijn graphs practical for DNA, sidestepping the NP-complete Hamiltonian model.

the problem it solved

Proving exactly when a walk that uses every edge once exists — and building one in time proportional to the number of edges.

why it matters: without it

"Use every link exactly once" would be a search over orders — hopeless beyond a few dozen edges — and DNA assembly would be stuck with an NP-complete model.

sources: Hierholzer — Ueber die Möglichkeit, einen Linienzug ohne Wiederholung und ohne Unterbrechung zu umfahren (Mathematische Annalen 6, 1873) ↗ · Sachs, Stiebitz & Wilson — An historical note: Euler's Königsberg letters (J. Graph Theory, 1988) ↗ · Wikipedia — Eulerian path (Euler's unproved 'if' direction; Fleury's 1883 algorithm) ↗ · Pevzner, Tang & Waterman — An Eulerian path approach to DNA fragment assembly (PNAS, 2001) ↗ · Compeau, Pevzner & Tesler — How to apply de Bruijn graphs to genome assembly (Nature Biotechnology, 2011) ↗

also in this chapter: Bridges and articulation points (low-link DFS) · Strongly connected components (Kosaraju, Tarjan) · Ratios as a weighted graph (and weighted union-find) · BFS over a derived graph (choose the vertices)