In this paper we initiate the study of computing a maximal (not necessarily maximum) repeating pattern in a single input string, where the corresponding problems have been studied (e.g., a maximal common subsequence) only in two or more input strings by Hirota and Sakai starting 2019. Given an input string $S$ of length $n$, we can compute a maximal square subsequence of $S$ in $O(n\log n)$ time, greatly improving the $O(n^2)$ bound for computing the longest square subsequence of $S$. For a maximal $k$-repeating subsequence, our bound is $O(f(k)n\log n)$, where \(f(k)\) is a computable function such that $f(k) < k\cdot 4^k$. This greatly improves the $O(n^{2k-1})$ bound for computing a longest $k$-repeating subsequence of $S$, for $k\geq 3$. Both results hold for the constrained case, i.e., when the solution must contain a subsequence $X$ of $S$, though with higher running times.
翻译:本文首次研究了在单个输入字符串中计算极大(不一定是最大)重复模式的问题,而相关问题(例如极大公共子序列)自2019年由Hirota和Sakai开始研究以来,仅在两个或更多输入字符串中被探讨。给定长度为$n$的输入字符串$S$,我们可以在$O(n\log n)$时间内计算出$S$的一个极大平方子序列,这极大地改进了计算$S$的最长平方子序列所需的$O(n^2)$时间界。对于极大$k$重复子序列,我们的时间界是$O(f(k)n\log n)$,其中\(f(k)\)是一个可计算函数,满足$f(k) < k\cdot 4^k$。这极大地改进了计算$S$的最长$k$重复子序列所需的$O(n^{2k-1})$时间界(对于$k\geq 3$)。上述两个结果在约束情况下(即解必须包含$S$的一个子序列$X$)也成立,尽管运行时间会更高。