Skip to main content

A Simple Grammar-Based Index for Finding Approximately Longest Common Substrings

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

Abstract

We show how, given positive constants \(\epsilon \) and \(\delta \), and an \(\alpha \)-balanced straight-line program with g rules for a text T[1..n], we can build an O(g)-space index that, given a pattern P[1..m], in \(O(m\log ^\delta g)\) time finds w.h.p. a substring of P that occurs in T and whose length is at least a \((1 - \epsilon )\) fraction of the longest common substring of P and T. The correctness can be ensured within the same expected query time.

Funded in part by NSERC grant RGPIN-07185-2020; NSF/BIO grant DBI-2029552; NIH/NHGRI grant R01HG011392; and Basal Funds FB0001, ANID, Chile.

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 59.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 74.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. Bille, P., Gørtz, I.L., Sach, B., Vildhøj, H.W.: Time-space trade-offs for longest common extensions. J. Discrete Algorithms 25, 42–50 (2014)

    Article  MathSciNet  MATH  Google Scholar 

  2. Chan, T.M., Larsen, K.G., Pătraşcu, M.: Orthogonal range searching on the RAM, revisited. In: Proceedings of the 27th ACM Symposium on Computational Geometry (SoCG), pp. 1–10 (2011)

    Google Scholar 

  3. Charalampopoulos, P., Kociumaka, T., Pissis, S.P., Radoszewski, J.: Faster algorithms for longest common substring. In: Proceedings of the 29th Annual European Symposium on Algorithms (ESA), pp. 30:1–30:17 (2021)

    Google Scholar 

  4. Charikar, M., et al.: The smallest grammar problem. IEEE Trans. Inf. Theory 51(7), 2554–2576 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  5. Claude, F., Navarro, G., Pacheco, A.: Grammar-compressed indexes with logarithmic search time. J. Comput. Syst. Sci. 118, 53–74 (2021)

    Article  MathSciNet  MATH  Google Scholar 

  6. Gao, Y.: Computing matching statistics on repetitive texts. In: Proceedings of the 32nd Data Compression Conference (DCC), pp. 73–82 (2022)

    Google Scholar 

  7. Gasieniec, L., Kolpakov, R., Potapov, I., Sant, P.: Real-time traversal in grammar-based compressed files. In: Proceedings of the 15th Data Compression Conference (DCC), p. 458 (2005)

    Google Scholar 

  8. Karp, R.M., Rabin, M.O.: Efficient randomized pattern-matching algorithms. IBM J. Res. Dev. 2, 249–260 (1987)

    Article  MathSciNet  MATH  Google Scholar 

  9. Kieffer, J.C., Yang, E.H.: Grammar-based codes: a new class of universal lossless source codes. IEEE Trans. Inf. Theory 46(3), 737–754 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  10. Navarro, G.: Indexing highly repetitive string collections, part I: repetitiveness measures. ACM Comput. Surv. 54(2) (2021). Article 29

    Google Scholar 

  11. Navarro, G.: Indexing highly repetitive string collections, part II: compressed indexes. ACM Comput. Surv. 54(2) (2021). Article 26

    Google Scholar 

  12. Navarro, G.: Computing MEMs on repetitive text collections. In: Proceedings of the 34th Annual Symposium on Combinatorial Pattern Matching (CPM), p. article 22 (2023)

    Google Scholar 

  13. Navarro, G., Prezza, N.: Universal compressed text indexing. Theor. Comput. Sci. 762, 41–50 (2019)

    Article  MathSciNet  MATH  Google Scholar 

  14. Ohno, T., Goto, K., Takabatake, Y., I, T., Sakamoto, H.: LZ-ABT: a practical algorithm for \(\alpha \)-balanced grammar compression. In: Iliopoulos, C., Leong, H.W., Sung, W.-K. (eds.) IWOCA 2018. LNCS, vol. 10979, pp. 323–335. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-94667-2_27

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Travis Gagie .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 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

Gagie, T., Kashgouli, S., Navarro, G. (2023). A Simple Grammar-Based Index for Finding Approximately Longest Common Substrings. In: Nardini, F.M., Pisanti, N., Venturini, R. (eds) String Processing and Information Retrieval. SPIRE 2023. Lecture Notes in Computer Science, vol 14240. Springer, Cham. https://doi.org/10.1007/978-3-031-43980-3_19

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-43980-3_19

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-43979-7

  • Online ISBN: 978-3-031-43980-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics