Las Vegas algorithms to generate universal cycles and de Bruijn sequences uniformly at random

Las Vegas algorithms to generate universal cycles and de Bruijn sequences uniformly at random
Notice: This research summary and analysis were automatically generated using AI technology. For absolute accuracy, please refer to the [Original Paper Viewer] below or the Original ArXiv Source.

We present practical algorithms for generating universal cycles uniformly at random. In particular, we consider universal cycles for shorthand permutations, subsets and multiset permutations, weak orders, and orientable sequences. Additionally, we consider de Bruijn sequences, weight-range de Bruin sequences, and de Bruijn sequences, with forbidden $0^z$ substring. Each algorithm, seeded with a random element from the given set, applies a random walk of an underlying Eulerian de Bruijn graph to obtain a random arborescence (spanning in-tree). Given the random arborescence and the de Bruijn graph, a corresponding random universal cycle can be generated in constant time per symbol. We present experimental results on the average cover time needed to compute a random arborescence for each object using a Las Vegas algorithm.


💡 Research Summary

The paper addresses the problem of generating universal cycles and de Bruijn sequences uniformly at random for a variety of combinatorial families. A universal cycle for a set S of strings is a cyclic string that contains every element of S exactly once as a substring; such a cycle exists precisely when the de Bruijn graph G(S) is Eulerian. The authors adopt a Las Vegas framework originally described by Kandel, Levine, and Peres (2006) and extend it to several concrete families: shorthand permutations, shorthand subsets, multiset permutations, weak orders, ordinary de Bruijn sequences, weight‑restricted de Bruijn sequences, de Bruijn sequences that forbid a run of z zeros, and orientable sequences.

The core algorithm, called Algorithm R, proceeds in four steps:

  1. Random edge selection – a random element of S is generated (e.g., by Fisher‑Yates shuffle for permutations, by random placement of k ones for subsets, by recursive content‑based sampling for weak orders). The selected string determines a directed edge (r, v) in G(S) and fixes the root vertex r for the subsequent arborescence.
  2. Random arborescence generation – a random spanning in‑tree rooted at r is obtained by performing a backward random walk on G(S) until every vertex has been visited. The first time a vertex is encountered, the traversed edge is recorded as a tree edge. This step’s runtime is governed by the cover time of the random walk.
  3. Adjacency list reordering – each tree edge (the “bridges”) is placed as the last entry in the outgoing adjacency list of its tail vertex; the remaining outgoing edges are permuted uniformly at random. This guarantees that the subsequent traversal will never “burn a bridge,” i.e., it will respect the tree structure.
  4. Eulerian traversal and output – starting from the root r, the algorithm follows the first unused edge in each adjacency list, emitting the edge label each time. Because the adjacency lists are pre‑ordered, this produces an Eulerian cycle of G(S) in constant time per symbol, which directly yields a universal cycle for S.

A crucial insight is that selecting a random edge (rather than a random vertex) as the root eliminates bias in non‑regular graphs; the authors illustrate this with a small example where choosing a vertex would over‑represent some cycles. The algorithm therefore generates each possible Eulerian cycle with exactly the same probability, a property not shared by earlier randomization schemes such as Fleury’s algorithm or the method of Lipták and Parmigiani (2018), which either miss cycles or produce a non‑uniform distribution.

For each combinatorial family the paper details how to generate a random seed element efficiently:

  • Shorthand permutations: generate a random permutation of {1,…,n} via Fisher‑Yates in O(n) time and drop the last symbol.
  • Shorthand subsets: randomly choose k positions for ones in an n‑bit string.
  • Multiset permutations: shuffle the multiset using the same Fisher‑Yates framework, handling duplicate elements.
  • Weak orders: decompose the set W(n) by Parikh vectors (content), order the classes lexicographically, and sample recursively using known counts |W_n| = Σ_{k=1}^n C(n,k)·W_{n−k}.
  • Weight‑restricted de Bruijn sequences: pre‑compute the number of strings of each weight in the interval

Comments & Academic Discussion

Loading comments...

Leave a Comment