English

Efficient LZ78 factorization of grammar compressed text

Data Structures and Algorithms 2013-05-27 v1

Abstract

We present an efficient algorithm for computing the LZ78 factorization of a text, where the text is represented as a straight line program (SLP), which is a context free grammar in the Chomsky normal form that generates a single string. Given an SLP of size nn representing a text SS of length NN, our algorithm computes the LZ78 factorization of TT in O(nN+mlogN)O(n\sqrt{N}+m\log N) time and O(nN+m)O(n\sqrt{N}+m) space, where mm is the number of resulting LZ78 factors. We also show how to improve the algorithm so that the nNn\sqrt{N} term in the time and space complexities becomes either nLnL, where LL is the length of the longest LZ78 factor, or (Nα)(N - \alpha) where α0\alpha \geq 0 is a quantity which depends on the amount of redundancy that the SLP captures with respect to substrings of SS of a certain length. Since m=O(N/logσN)m = O(N/\log_\sigma N) where σ\sigma is the alphabet size, the latter is asymptotically at least as fast as a linear time algorithm which runs on the uncompressed string when σ\sigma is constant, and can be more efficient when the text is compressible, i.e. when mm and nn are small.

Keywords

Cite

@article{arxiv.1207.4607,
  title  = {Efficient LZ78 factorization of grammar compressed text},
  author = {Hideo Bannai and Shunsuke Inenaga and Masayuki Takeda},
  journal= {arXiv preprint arXiv:1207.4607},
  year   = {2013}
}

Comments

SPIRE 2012

R2 v1 2026-06-21T21:38:21.089Z