Skip to main content

Maximal Closed Substrings

  • Conference paper
  • First Online:
String Processing and Information Retrieval (SPIRE 2022)

Abstract

A string is closed if it has length 1 or has a nonempty border without internal occurrences. In this paper we introduce the definition of a maximal closed substring (MCS), which is an occurrence of a closed substring that cannot be extended to the left nor to the right into a longer closed substring. MCSs with exponent at least 2 are commonly called runs; those with exponent smaller than 2, instead, are particular cases of maximal gapped repeats. We show that a string of length n contains \(\mathcal O(n^{1.5})\) MCSs. We also provide an output-sensitive algorithm that, given a string of length n over a constant-size alphabet, locates all m MCSs the string contains in \(\mathcal O(n\log n + m)\) time.

Gabriele Fici is partly supported by MIUR project PRIN 2017 ADASCOML – 2017K7XPAN. Simon J. Puglisi is partly supported by the Academy of Finland, through grant 339070.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 64.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 84.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Badkobeh, G., Fici, G., Lipták, Z.: On the number of closed factors in a word. In: Dediu, A.-H., Formenti, E., Martín-Vide, C., Truthe, B. (eds.) LATA 2015. LNCS, vol. 8977, pp. 381–390. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-15579-1_29

    Chapter  Google Scholar 

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

    Article  MathSciNet  MATH  Google Scholar 

  3. Brodal, G.S., Lyngsø, R.B., Pedersen, C.N.S., Stoye, J.: Finding maximal pairs with bounded gap. In: Crochemore, M., Paterson, M. (eds.) CPM 1999. LNCS, vol. 1645, pp. 134–149. Springer, Heidelberg (1999). https://doi.org/10.1007/3-540-48452-3_11

    Chapter  Google Scholar 

  4. Brown, M.R., Tarjan, R.E.: A fast merging algorithm. J. ACM 26(2), 211–226 (1979)

    Article  MathSciNet  MATH  Google Scholar 

  5. Bucci, M., De Luca, A., Fici, G.: Enumeration and structure of trapezoidal words. Theor. Comput. Sci. 468, 12–22 (2013)

    Article  MathSciNet  MATH  Google Scholar 

  6. Carpi, A., de Luca, A.: Periodic-like words, periodicity, and boxes. Acta Informatica 37(8), 597–618 (2001). https://doi.org/10.1007/PL00013314

    Article  MathSciNet  MATH  Google Scholar 

  7. De Luca, A., Fici, G., Zamboni, L.Q.: The sequence of open and closed prefixes of a Sturmian word. Adv. Appl. Math. 90, 27–45 (2017)

    Article  MathSciNet  MATH  Google Scholar 

  8. Fici, G.: Open and Closed Words. Bull. Eur. Assoc. Theor. Comput. Sci. EATCS 123, 140–149 (2017)

    MathSciNet  MATH  Google Scholar 

  9. Fine, N.J., Wilf, H.S.: Uniqueness theorems for periodic functions. P. Am. Math. Soc. 16(1), 109–114 (1965)

    Article  MathSciNet  MATH  Google Scholar 

  10. Gawrychowski, P., I, T., Inenaga, S., Köppl, D., Manea, F.: Tighter bounds and optimal algorithms for all maximal \(\alpha \)-gapped repeats and palindromes. Theor. Comput. Syst. 62(1), 162–191 (2017). https://doi.org/10.1007/s00224-017-9794-5

    Article  MATH  Google Scholar 

  11. Kolpakov, R., Podolskiy, M., Posypkin, M., Khrapov, N.: Searching of gapped repeats and subrepetitions in a word. J. Discrete Algorithms 46–47, 1–15 (2017). https://doi.org/10.1007/978-3-319-07566-2_22

    Article  MathSciNet  MATH  Google Scholar 

  12. Kolpakov, R.M., Kucherov, G.: Finding maximal repetitions in a word in linear time. In: 40th Annual Symposium on Foundations of Computer Science, FOCS 1999, 17–18 October 1999, New York, NY, USA, pp. 596–604. IEEE Computer Society (1999)

    Google Scholar 

  13. Morris, J.H., Pratt, V.R.: A linear pattern-matching algorithm. Technical Report 40, University of California, Berkeley (1970)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Gabriele Fici .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Badkobeh, G., De Luca, A., Fici, G., Puglisi, S.J. (2022). Maximal Closed Substrings. In: Arroyuelo, D., Poblete, B. (eds) String Processing and Information Retrieval. SPIRE 2022. Lecture Notes in Computer Science, vol 13617. Springer, Cham. https://doi.org/10.1007/978-3-031-20643-6_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-20643-6_2

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-20642-9

  • Online ISBN: 978-3-031-20643-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics