Optimal Enumeration of Eulerian Trails in Directed Graphs
Abstract
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 with the arborescences in . In particular, one can use the BEST theorem to count the Eulerian trails in in polynomial time. For enumerating the Eulerian trails in , one could naturally resort to first enumerating the arborescences in and then exploiting the insight of the BEST theorem to enumerate the Eulerian trails in : every arborescence in corresponds to at least one Eulerian trail in . For over two decades, the fastest algorithm for enumerating arborescences in took time, where , , and is the number of arborescences in [Uno, ISAAC 1998]. Since Uno's algorithm does not lead to an optimal enumeration of Eulerian trails in directed graphs, we were motivated to develop a direct algorithm for this problem. Our central contribution is a remarkably simple algorithm to directly enumerate the Eulerian trails in in the optimal time. As a consequence, our result improves on an implementation of the BEST theorem for counting Eulerian trails in when , and also unconditionally improves the combinatorial -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.
Keywords
Cite
@article{arxiv.2603.12894,
title = {Optimal Enumeration of Eulerian Trails in Directed Graphs},
author = {Ben Bals and Solon P. Pissis and Matei Tinca},
journal= {arXiv preprint arXiv:2603.12894},
year = {2026}
}