Skip to main content

Computing Longest (Common) Lyndon Subsequences

  • Conference paper
  • First Online:
Combinatorial Algorithms (IWOCA 2022)

Abstract

Given a string T with length n whose characters are drawn from an ordered alphabet of size \(\sigma \), its longest Lyndon subsequence is a longest subsequence of T that is a Lyndon word. We propose algorithms for finding such a subsequence in \(\mathcal {O}(n^3)\) time with \(\mathcal {O}(n)\) space, or online in \(\mathcal {O}(n^3 \sigma )\) space and time. Our first result can be extended to find the longest common Lyndon subsequence of two strings of length n in \(\mathcal {O}(n^4 \sigma )\) time using \(\mathcal {O}(n^3)\) space.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    https://leetcode.com/problems/find-the-most-competitive-subsequence/.

References

  1. Bannai, H., I, T., Inenaga, S., Nakashima, Y., Takeda, M., Tsuruta, K.: The “runs” theorem. SIAM J. Comput. 46(5), 1501–1514 (2017)

    Google Scholar 

  2. de Beauregard Robinson, G.: On the representations of the symmetric group. Am. J. Math. 60(3), 745–760 (1938)

    Article  Google Scholar 

  3. Bender, M.A., Farach-Colton, M., Pemmasani, G., Skiena, S., Sumazin, P.: Lowest common ancestors in trees and directed acyclic graphs. J. Algorithms 57(2), 75–94 (2005)

    Article  MathSciNet  Google Scholar 

  4. Biedl, T.C., et al.: Rollercoasters: long sequences without short runs. SIAM J. Discret. Math. 33(2), 845–861 (2019)

    Article  MathSciNet  Google Scholar 

  5. Chen, K.T., Fox, R.H., Lyndon, R.C.: Free differential calculus, IV. The quotient groups of the lower central series. Ann. Math. Second Ser. 68(1), 81–95 (1958). https://www.jstor.org/stable/1970044. Mathematics Department, Princeton University

  6. Chowdhury, S.R., Hasan, M.M., Iqbal, S., Rahman, M.S.: Computing a longest common palindromic subsequence. Fundam. Inform. 129(4), 329–340 (2014)

    Article  MathSciNet  Google Scholar 

  7. Cole, R., Hariharan, R.: Dynamic LCA queries on trees. SIAM J. Comput. 34(4), 894–923 (2005)

    Article  MathSciNet  Google Scholar 

  8. Dietz, P.F.: Finding level-ancestors in dynamic trees. In: Dehne, F., Sack, J.R., Santoro, N. (eds.) Algorithms and Data Structures. WADS 1991. LNCS, vol. 519, pp. 32–40. Springer, Heidelberg (1991). https://doi.org/10.1007/BFb0028247. ISBN 978-3-540-47566-8

  9. Duval, J.: Factorizing words over an ordered alphabet. J. Algorithms 4(4), 363–381 (1983)

    Article  MathSciNet  Google Scholar 

  10. Elmasry, A.: The longest almost-increasing subsequence. Inf. Process. Lett. 110(16), 655–658 (2010)

    Article  MathSciNet  Google Scholar 

  11. Fujita, K., Nakashima, Y., Inenaga, S., Bannai, H., Takeda, M.: Longest common rollercoasters. In: Lecroq, T., Touzet, H. (eds.) SPIRE 2021. LNCS, vol. 12944, pp. 21–32. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-86692-1_3

    Chapter  Google Scholar 

  12. Gawrychowski, P., Manea, F., Serafin, R.: Fast and longest rollercoasters. In: Proceedings of STACS. LIPIcs, vol. 126, pp. 30:1–30:17 (2019)

    Google Scholar 

  13. Glen, A., Simpson, J., Smyth, W.F.: Counting Lyndon factors. Electron. J. Comb. 24(3), P3.28 (2017)

    Google Scholar 

  14. Grossi, R., Gupta, A., Vitter, J.S.: High-order entropy-compressed text indexes. In: Proceedings of SODA, pp. 841–850 (2003)

    Google Scholar 

  15. He, X., Xu, Y.: The longest commonly positioned increasing subsequences problem. J. Comb. Optim. 35(2), 331–340 (2017). https://doi.org/10.1007/s10878-017-0170-9

    Article  MathSciNet  MATH  Google Scholar 

  16. Hirakawa, R., Nakashima, Y., Inenaga, S., Takeda, M.: Counting Lyndon subsequences. In: Proceedings of PSC, pp. 53–60 (2021)

    Google Scholar 

  17. Hirschberg, D.S.: Algorithms for the longest common subsequence problem. J. ACM 24(4), 664–675 (1977)

    Article  MathSciNet  Google Scholar 

  18. Inenaga, S., Hyyrö, H.: A hardness result and new algorithm for the longest common palindromic subsequence problem. Inf. Process. Lett. 129, 11–15 (2018)

    Article  MathSciNet  Google Scholar 

  19. Kiyomi, M., Horiyama, T., Otachi, Y.: Longest common subsequence in sublinear space. Inf. Process. Lett. 168, 106084 (2021)

    Article  MathSciNet  Google Scholar 

  20. Knuth, D.: Permutations, matrices, and generalized Young tableaux. Pac. J. Math. 34, 709–727 (1970)

    Article  MathSciNet  Google Scholar 

  21. Kosche, M., Koß, T., Manea, F., Siemer, S.: Absent subsequences in words. In: Bell, P.C., Totzke, P., Potapov, I. (eds.) RP 2021. LNCS, vol. 13035, pp. 115–131. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-89716-1_8

    Chapter  Google Scholar 

  22. Kosowski, A.: An efficient algorithm for the longest tandem scattered subsequence problem. In: Apostolico, A., Melucci, M. (eds.) SPIRE 2004. LNCS, vol. 3246, pp. 93–100. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-30213-1_13

    Chapter  Google Scholar 

  23. Kutz, M., Brodal, G.S., Kaligosi, K., Katriel, I.: Faster algorithms for computing longest common increasing subsequences. J. Discrete Algorithms 9(4), 314–325 (2011)

    Article  MathSciNet  Google Scholar 

  24. Lyndon, R.C.: On Burnside’s problem. Trans. Am. Math. Soc. 77(2), 202–215 (1954)

    MathSciNet  MATH  Google Scholar 

  25. Schensted, C.: Longest increasing and decreasing subsequences. Can. J. Math. 13, 179–191 (1961)

    Article  MathSciNet  Google Scholar 

  26. Ta, T.T., Shieh, Y., Lu, C.L.: Computing a longest common almost-increasing subsequence of two sequences. Theor. Comput. Sci. 854, 44–51 (2021)

    Article  MathSciNet  Google Scholar 

  27. Wagner, R.A., Fischer, M.J.: The string-to-string correction problem. J. ACM 21(1), 168–173 (1974)

    Article  MathSciNet  Google Scholar 

Download references

Acknowledgments

This work was supported by JSPS KAKENHI Grant Numbers JP20H04141 (HB), JP19K20213 (TI), JP21K17701 and JP21H05847 (DK). TK was supported by NSF 1652303, 1909046, and HDR TRIPODS 1934846 grants, and an Alfred P. Sloan Fellowship.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Dominik Köppl .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Bannai, H., I, T., Kociumaka, T., Köppl, D., Puglisi, S.J. (2022). Computing Longest (Common) Lyndon Subsequences. In: Bazgan, C., Fernau, H. (eds) Combinatorial Algorithms. IWOCA 2022. Lecture Notes in Computer Science, vol 13270. Springer, Cham. https://doi.org/10.1007/978-3-031-06678-8_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-06678-8_10

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-06677-1

  • Online ISBN: 978-3-031-06678-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics