Efficient Lyndon Factorization of Grammar Compressed Text

  • Tomohiro I
  • Yuto Nakashima
  • Shunsuke Inenaga
  • Hideo Bannai
  • Masayuki Takeda
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7922)


We present an algorithm for computing the Lyndon factorization of a string that is given in grammar compressed form, namely, a Straight Line Program (SLP). The algorithm runs in O(n 4 + mn 3 h) time and O(n 2) space, where m is the size of the Lyndon factorization, n is the size of the SLP, and h is the height of the derivation tree of the SLP. Since the length of the decompressed string can be exponentially large w.r.t. n, m and h, our result is the first polynomial time solution when the string is given as SLP.


String Match Derivation Tree Circular Permutation Short String Straight Line Program 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Apostolico, A., Crochemore, M.: Fast parallel Lyndon factorization with applications. Mathematical Systems Theory 28(2), 89–108 (1995)MathSciNetzbMATHCrossRefGoogle Scholar
  2. 2.
    Breslauer, D., Grossi, R., Mignosi, F.: Simple real-time constant-space string matching. In: Giancarlo, R., Manzini, G. (eds.) CPM 2011. LNCS, vol. 6661, pp. 173–183. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  3. 3.
    Brlek, S., Lachaud, J.O., Provençal, X., Reutenauer, C.: Lyndon + Christoffel = digitally convex. Pattern Recognition 42(10), 2239–2246 (2009)zbMATHCrossRefGoogle Scholar
  4. 4.
    Chemillier, M.: Periodic musical sequences and Lyndon words. Soft Comput. 8(9), 611–616 (2004)zbMATHGoogle Scholar
  5. 5.
    Chen, K.T., Fox, R.H., Lyndon, R.C.: Free differential calculus. iv. The quotient groups of the lower central series. Annals of Mathematics 68(1), 81–95 (1958)MathSciNetCrossRefGoogle Scholar
  6. 6.
    Crochemore, M., Perrin, D.: Two-way string matching. J. ACM 38(3), 651–675 (1991)MathSciNetzbMATHCrossRefGoogle Scholar
  7. 7.
    Daykin, J.W., Iliopoulos, C.S., Smyth, W.F.: Parallel RAM algorithms for factorizing words. Theor. Comput. Sci. 127(1), 53–67 (1994)MathSciNetzbMATHCrossRefGoogle Scholar
  8. 8.
    Delgrange, O., Rivals, E.: STAR: an algorithm to search for tandem approximate repeats. Bioinformatics 20(16), 2812–2820 (2004)CrossRefGoogle Scholar
  9. 9.
    Duval, J.P.: Factorizing words over an ordered alphabet. J. Algorithms 4(4), 363–381 (1983)MathSciNetzbMATHCrossRefGoogle Scholar
  10. 10.
    Fredricksen, H., Maiorana, J.: Necklaces of beads in k colors and k-ary de Bruijn sequences. Discrete Mathematics 23(3), 207–210 (1978)MathSciNetzbMATHCrossRefGoogle Scholar
  11. 11.
    Gawrychowski, P.: Optimal pattern matching in LZW compressed strings. In: Proc. SODA 2011, pp. 362–372 (2011)Google Scholar
  12. 12.
    Gawrychowski, P.: Pattern matching in Lempel-Ziv compressed strings: Fast, simple, and deterministic. In: Demetrescu, C., Halldórsson, M.M. (eds.) ESA 2011. LNCS, vol. 6942, pp. 421–432. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  13. 13.
    Gawrychowski, P.: Faster algorithm for computing the edit distance between SLP-compressed strings. In: Calderón-Benavides, L., González-Caro, C., Chávez, E., Ziviani, N. (eds.) SPIRE 2012. LNCS, vol. 7608, pp. 229–236. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  14. 14.
    Gil, J.Y., Scott, D.A.: A bijective string sorting transform. CoRR abs/1201.3077 (2012)Google Scholar
  15. 15.
    Goto, K., Bannai, H., Inenaga, S., Takeda, M.: Fast q-gram mining on SLP compressed strings. Journal of Discrete Algorithms 18, 89–99 (2013)MathSciNetCrossRefGoogle Scholar
  16. 16.
    Hermelin, D., Landau, G.M., Landau, S., Weimann, O.: A unified algorithm for accelerating edit-distance computation via text-compression. In: Proc. STACS 2009, pp. 529–540 (2009)Google Scholar
  17. 17.
    Kufleitner, M.: On bijective variants of the Burrows-Wheeler transform. In: Proc. PSC 2009, pp. 65–79 (2009)Google Scholar
  18. 18.
    Lifshits, Y.: Solving classical string problems an compressed texts. In: Combinatorial and Algorithmic Foundations of Pattern and Association Discovery. Dagstuhl Seminar Proceedings, vol. 06201 (2006)Google Scholar
  19. 19.
    Lifshits, Y.: Processing compressed texts: A tractability border. In: Ma, B., Zhang, K. (eds.) CPM 2007. LNCS, vol. 4580, pp. 228–240. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  20. 20.
    Lyndon, R.C.: On Burnside’s problem. Transactions of the American Mathematical Society 77, 202–215 (1954)MathSciNetzbMATHGoogle Scholar
  21. 21.
    Miyazaki, M., Shinohara, A., Takeda, M.: An improved pattern matching algorithm for strings in terms of straight-line programs. In: Hein, J., Apostolico, A. (eds.) CPM 1997. LNCS, vol. 1264, pp. 1–11. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  22. 22.
    Mucha, M.: Lyndon words and short superstrings. In: Proc. SODA 2013, pp. 958–972 (2013)Google Scholar
  23. 23.
    Neuburger, S., Sokol, D.: Succinct 2D dictionary matching. Algorithmica, 1–23 (2012), 10.1007/s00453-012-9615-9 Google Scholar
  24. 24.
    Provençal, X.: Minimal non-convex words. Theor. Comput. Sci. 412(27), 3002–3009 (2011)zbMATHCrossRefGoogle Scholar
  25. 25.
    Yamamoto, T., Bannai, H., Inenaga, S., Takeda, M.: Faster subsequence and don’t-care pattern matching on compressed texts. In: Giancarlo, R., Manzini, G. (eds.) CPM 2011. LNCS, vol. 6661, pp. 309–322. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  26. 26.
    Ziv, J., Lempel, A.: Compression of individual sequences via variable-length coding. IEEE Transactions on Information Theory 24(5), 530–536 (1978)MathSciNetzbMATHCrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Tomohiro I
    • 1
    • 2
  • Yuto Nakashima
    • 1
  • Shunsuke Inenaga
    • 1
  • Hideo Bannai
    • 1
  • Masayuki Takeda
    • 1
  1. 1.Department of InformaticsKyushu UniversityJapan
  2. 2.Japan Society for the Promotion of Science (JSPS)Japan

Personalised recommendations