A cut-down de Bruijn sequence is a cyclic string of length $L$, where $1 \leq L \leq k^n$, such that every substring of length $n$ appears at most once. Etzion [Theor. Comp. Sci 44 (1986)] gives an algorithm to construct binary cut-down de Bruijn sequences that requires $o(n)$ simple $n$-bit operations per symbol generated. In this paper, we simplify the algorithm and improve the running time to $\mathcal{O}(n)$ time per symbol generated using $\mathcal{O}(n)$ space. We then provide the first successor-rule approach for constructing a binary cut-down de Bruijn sequence by leveraging recent ranking algorithms for fixed-density Lyndon words. Finally, we develop an algorithm to generate cut-down de Bruijn sequences for $k>2$ that runs in $\mathcal{O}(n)$ time per symbol using $\mathcal{O}(n)$ space after some initialization. While our $k$-ary algorithm is based on our simplified version of Etzion's binary algorithm, a number of non-trivial adaptations are required to generalize to larger alphabets.
翻译:简化版de Bruijn序列是指长度为$L$(其中$1 \leq L \leq k^n$)的循环字符串,且每个长度为$n$的子串最多出现一次。Etzion [Theor. Comp. Sci 44 (1986)] 提出了一种构造二进制简化版de Bruijn序列的算法,该算法在生成每个符号时需进行$o(n)$次简单的$n$位操作。本文对该算法进行了简化,并将运行时间改进为每个符号生成所需$\mathcal{O}(n)$时间,同时使用$\mathcal{O}(n)$空间。随后,我们利用近期提出的固定密度Lyndon词排名算法,首次提出了一种基于后继规则的二进制简化版de Bruijn序列构造方法。最后,我们开发了一种适用于$k>2$的简化版de Bruijn序列生成算法,该算法在初始化后,每个符号生成时运行时间为$\mathcal{O}(n)$,空间复杂度为$\mathcal{O}(n)$。尽管我们的$k$元算法基于Etzion二进制算法的简化版本,但为了推广至更大字母表,仍需进行多项非平凡调整。