A universal cycle for a set S of combinatorial objects is a cyclic sequence of length |S|that contains a representation of each element in S exactly once as a substring. If S is the set of k-subsets of [n] = {1, 2, . . . , n}, it is well-known that universal cycles do not always exists when applying a simple string representation, where 12 or 21 could represent the subset {1, 2}. Similarly, if S is the set of k-multisets of [n], it is also known that universal cycles do not always exist using a similar representation, where 112, 121, or 211 could represent the multiset {1, 1, 2}. By mapping these sets to an appropriate family of labeled graphs, universal cycles are known to exist, but without a known efficient construction. In this paper we consider a new representation for k-subsets and k-multisets that leads to efficient universal cycle constructions for all n, k >=2. We provide successor-rule algorithms to construct such universal cycles in O(n) time per symbol using O(n) space and demonstrate that necklace concatenation algorithms allow the same sequences to be generated in O(1) amortized time per symbol. They are the first known efficient universal cycle constructions for k-multisets. The results are obtained by considering constructions for bounded-weight de Bruijn sequences. In particular, we demonstrate that a bounded-weight generalization of the Grandmama de Bruijn sequence can be constructed in O(1) amortized time per symbol.
翻译:对于组合对象集合S,通用循环是指一个长度为|S|的循环序列,其中每个元素恰好作为子串出现一次。若S为[n] = {1, 2, ..., n}的所有k-子集构成的集合,已知当采用简单字符串表示(例如用12或21表示子集{1, 2})时,通用循环并非始终存在。类似地,若S为[n]的所有k-多重集构成的集合,在采用相似表示(例如用112、121或211表示多重集{1, 1, 2})时,通用循环也非始终存在。通过将这些集合映射到适当的带标号图族,已知通用循环存在,但缺乏已知的高效构造方法。本文提出一种新的k-子集与k-多重集表示方法,从而为所有n, k >=2实现高效的通用循环构造。我们提供后继规则算法,可在O(n)空间复杂度下以每个符号O(n)时间构造此类通用循环,并证明项链拼接算法能够以每个符号O(1)均摊时间生成相同序列。这是首个已知的k-多重集高效通用循环构造方法。这些结果通过研究有界权值de Bruijn序列的构造获得。特别地,我们证明Grandmama de Bruijn序列的有界权值推广版本可以每个符号O(1)均摊时间构造。