Space-Efficient Hierholzer: Eulerian Cycles in $\mathrm{O}(m)$ Time and $\mathrm{O}(n)$ Space
Ziad Ismaili Alaoui, Detlef Plump, Sebastian Wild

TL;DR
This paper presents a space-efficient variant of Hierholzer's algorithm that finds Eulerian cycles in linear time using significantly less memory, especially beneficial for dense graphs.
Contribution
It introduces a simple, linear-time algorithm for Eulerian cycles that uses only O(n) bits of space, improving over traditional methods.
Findings
Uses O(n log m) bits of memory, reducing space compared to O(m log n).
Runs in linear time, matching classical algorithms.
First known linear-time, space-efficient Eulerian cycle algorithm.
Abstract
We describe a simple variant of Hierholzer's algorithm that finds an Eulerian cycle in a (multi)graph with vertices and edges using bits of working memory. This substantially improves the working space compared to standard implementations of Hierholzer's algorithm, which use bits of space. Our algorithm runs in linear time, like the classical versions, but avoids an -size stack of vertices or storing information for each edge. To our knowledge, this is the first linear-time algorithm to achieve this space bound, and the method is very easy to implement. The correctness argument, by contrast, is surprisingly subtle; we give a detailed formal proof. The space savings are particularly relevant for dense graphs or multigraphs with large edge multiplicities.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
