Eulerian Path
Run Hierholzer stack traversal, consume every edge once, and append vertices while dead ends unwind.
Core idea
Hierholzer's algorithm walks unused edges until it reaches a dead end. Dead-end vertices are appended while the stack unwinds, automatically splicing every discovered cycle into one trail.
Read the visualization
Remaining-degree badges shrink as edges are consumed. The traversal stack records the live walk, and backtracking builds the answer in reverse order.
Load the connected graph and the requirement to use every edge exactly once.
Complexity and tradeoffs
Time: O(V+E). Space: O(V+E). Connectivity and odd-degree conditions determine whether an undirected Eulerian trail exists.
Where it fits
Eulerian trails model route inspection, DNA assembly with de Bruijn graphs, and reconstruction from adjacent pairs. Hamiltonian paths instead require visiting vertices once and are much harder.