[Paper Review] Optimal Enumeration of Eulerian Trails in Directed Graphs
The paper presents a simple, time-optimal algorithm to directly enumerate all Eulerian trails in directed graphs in O(m + z_T) time, improving over BEST-based counting and previous O(m·z_T) approaches.
The BEST theorem, due to de Bruijn, van Aardenne-Ehrenfest, Smith, and Tutte, is a classical tool from graph theory that links the Eulerian trails in a directed graph $G=(V,E)$ with the arborescences in $G$. In particular, one can use the BEST theorem to count the Eulerian trails in $G$ in polynomial time. For enumerating the Eulerian trails in $G$, one could naturally resort to first enumerating the arborescences in $G$ and then exploiting the insight of the BEST theorem to enumerate the Eulerian trails in $G$: every arborescence in $G$ corresponds to at least one Eulerian trail in $G$. Instead, we take a simple and direct approach. Our central contribution is a remarkably simple algorithm to directly enumerate the $z_T$ Eulerian trails in $G$ in the \emph{optimal} $O(m + z_T)$ time. As a consequence, our result improves on an implementation of the BEST theorem for counting Eulerian trails in $G$ when $z_T=o(n^2)$, and, in addition, it unconditionally improves the combinatorial $O(m\cdot z_T)$-time algorithm of Conte et al. [FCT 2021] for the same task. Moreover, we show that, with some care, our algorithm can be extended to enumerate Eulerian trails in directed multigraphs in optimal time, enabling applications in bioinformatics and data privacy.
Motivation & Objective
- Motivated by the need to enumerate Eulerian trails efficiently in directed graphs, beyond counting via the BEST theorem.
- To design a direct enumeration algorithm with optimal O(m + z_T) time complexity.
- To compress the output representation to a compact state tree while preserving completeness and correctness.
- To extend the approach to directed multigraphs for applications in bioinformatics and data privacy.
Proposed method
- Introduce the state tree (a compressed prefix tree of Eulerian trails) as the main data structure.
- Develop two compression rules (out-degree one contraction and a SCC-based rule) to bound the compressed state tree size to O(m + z_T).
- Prove soundness via bijections between trails before/after compression.
- Use a DFS-like exploration that extends prefixes along full Hierholzer-based completions, with constant-time updates to the compressed remaining graph.
- Show that the compressed state tree has only O(m + z_T) states, enabling O(m + z) enumeration of z trails.
- Extend the algorithm to directed multigraphs with careful handling of contractions and crossings.
Experimental results
Research questions
- RQ1Can Eulerian trails in directed graphs be enumerated directly in optimal time without enumerating arborescences?
- RQ2What compression strategies yield a compressed representation of all trails with size O(m + z_T)?
- RQ3How can the remaining graph be maintained efficiently during enumeration to support a linear-time DFS traversal?
- RQ4Can the approach be extended to directed multigraphs while preserving optimal time complexity?
Key findings
- An O(m + z_T) time algorithm to enumerate all Eulerian trails in directed graphs (or enumerate up to z_T trails) is achieved.
- A compressed state tree of size O(m + z_T) suffices to represent all trails; every leaf corresponds to an Eulerian trail.
- Two compression rules ensure non-branching regions are collapsed without losing correctness, enabling constant-time updates per state transition.
- The approach yields improvements over the combinatorial O(m · z_T) time algorithm and to BEST-based counting when z_T is small relative to n^2.
- The method generalizes to directed multigraphs, broadening applicability to bioinformatics and data privacy.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.