English

Computing Maximal Repeating Subsequences in a String

Data Structures and Algorithms 2026-01-21 v1 Formal Languages and Automata Theory

Abstract

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 SS of length nn, we can compute a maximal square subsequence of SS in O(nlogn)O(n\log n) time, greatly improving the O(n2)O(n^2) bound for computing the longest square subsequence of SS. For a maximal kk-repeating subsequence, our bound is O(f(k)nlogn)O(f(k)n\log n), where f(k)f(k) is a computable function such that f(k)<k4kf(k) < k\cdot 4^k. This greatly improves the O(n2k1)O(n^{2k-1}) bound for computing a longest kk-repeating subsequence of SS, for k3k\geq 3. Both results hold for the constrained case, i.e., when the solution must contain a subsequence XX of SS, though with higher running times.

Keywords

Cite

@article{arxiv.2601.12200,
  title  = {Computing Maximal Repeating Subsequences in a String},
  author = {Mingyang Gong and Adiesha Liyanage and Braeden Sopp and Binhai Zhu},
  journal= {arXiv preprint arXiv:2601.12200},
  year   = {2026}
}

Comments

19 pages,1 figure, 4 algorithms