A subsequence of a word $w$ is a word $u$ such that $u = w[i_1] w[i_2] , \dots w[i_{|u|}]$, for some set of indices $1 \leq i_1 < i_2 < \dots < i_k \leq |w|$. A word $w$ is $k$-subsequence universal over an alphabet $\Sigma$ if every word in $\Sigma^k$ appears in $w$ as a subsequence. In this paper, we provide new algorithms for $k$-subsequence universal words of fixed length $n$ over the alphabet $\Sigma = \{1,2,\dots, \sigma\}$. Letting $\mathcal{U}(n,k,\sigma)$ denote the set of $n$-length $k$-subsequence universal words over $\Sigma$, we provide: * an $O(n k \sigma)$ time algorithm for counting the size of $\mathcal{U}(n,k,\sigma)$; * an $O(n k \sigma)$ time algorithm for ranking words in the set $\mathcal{U}(n,k,\sigma)$; * an $O(n k \sigma)$ time algorithm for unranking words from the set $\mathcal{U}(n,k,\sigma)$; * an algorithm for enumerating the set $\mathcal{U}(n,k,\sigma)$ with $O(n \sigma)$ delay after $O(n k \sigma)$ preprocessing.
翻译:单词 $w$ 的一个子序列是指存在索引集合 $1 \leq i_1 < i_2 < \dots < i_k \leq |w|$ 使得 $u = w[i_1] w[i_2] , \dots w[i_{|u|}]$ 的单词 $u$。若字母表 $\Sigma$ 上的每个长度为 $k$ 的单词均作为子序列出现在 $w$ 中,则称单词 $w$ 是 $k$ 子序列通用的。本文针对字母表 $\Sigma = \{1,2,\dots, \sigma\}$ 上固定长度 $n$ 的 $k$ 子序列通用单词提出新算法。记 $\mathcal{U}(n,k,\sigma)$ 为 $\Sigma$ 上所有长度为 $n$ 的 $k$ 子序列通用单词的集合,我们提供:* 一个 $O(n k \sigma)$ 时间算法用于计数 $\mathcal{U}(n,k,\sigma)$ 的大小;* 一个 $O(n k \sigma)$ 时间算法用于对 $\mathcal{U}(n,k,\sigma)$ 中的单词进行排序;* 一个 $O(n k \sigma)$ 时间算法用于对 $\mathcal{U}(n,k,\sigma)$ 中的单词进行逆排序;* 一个在 $O(n k \sigma)$ 预处理后以 $O(n \sigma)$ 延迟枚举 $\mathcal{U}(n,k,\sigma)$ 的算法。