English

Computing convolution on grammar-compressed text

Data Structures and Algorithms 2013-03-19 v1

Abstract

The convolution between a text string SS of length NN and a pattern string PP of length mm can be computed in O(Nlogm)O(N \log m) time by FFT. It is known that various types of approximate string matching problems are reducible to convolution. In this paper, we assume that the input text string is given in a compressed form, as a \emph{straight-line program (SLP)}, which is a context free grammar in the Chomsky normal form that derives a single string. Given an SLP S\mathcal{S} of size nn describing a text SS of length NN, and an uncompressed pattern PP of length mm, we present a simple O(nmlogm)O(nm \log m)-time algorithm to compute the convolution between SS and PP. We then show that this can be improved to O(min{nm,Nα}logm)O(\min\{nm, N-\alpha\} \log m) time, where α0\alpha \geq 0 is a value that represents the amount of redundancy that the SLP captures with respect to the length-mm substrings. The key of the improvement is our new algorithm that computes the convolution between a trie of size rr and a pattern string PP of length mm in O(rlogm)O(r \log m) time.

Keywords

Cite

@article{arxiv.1303.3945,
  title  = {Computing convolution on grammar-compressed text},
  author = {Toshiya Tanaka and Tomohiro I and Shunsuke Inenaga and Hideo Bannai and Masayuki Takeda},
  journal= {arXiv preprint arXiv:1303.3945},
  year   = {2013}
}

Comments

DCC 2013

R2 v1 2026-06-21T23:43:04.633Z