English

Detecting regularities on grammar-compressed strings

Data Structures and Algorithms 2013-04-29 v1

Abstract

We solve the problems of detecting and counting various forms of regularities in a string represented as a Straight Line Program (SLP). Given an SLP of size nn that represents a string ss of length NN, our algorithm compute all runs and squares in ss in O(n3h)O(n^3h) time and O(n2)O(n^2) space, where hh is the height of the derivation tree of the SLP. We also show an algorithm to compute all gapped-palindromes in O(n3h+gnhlogN)O(n^3h + gnh\log N) time and O(n2)O(n^2) space, where gg is the length of the gap. The key technique of the above solution also allows us to compute the periods and covers of the string in O(n2h)O(n^2 h) time and O(nh(n+log2N))O(nh(n+\log^2 N)) time, respectively.

Keywords

Cite

@article{arxiv.1304.7067,
  title  = {Detecting regularities on grammar-compressed strings},
  author = {Tomohiro I and Wataru Matsubara and Kouji Shimohira and Shunsuke Inenaga and Hideo Bannai and Masayuki Takeda and Kazuyuki Narisawa and Ayumi Shinohara},
  journal= {arXiv preprint arXiv:1304.7067},
  year   = {2013}
}
R2 v1 2026-06-22T00:06:43.615Z