Skip to main content

Range LCP Queries Revisited

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 9309))

Abstract

The Range LCP problem is to preprocess a string \(S[1\dots n]\), to enable efficient solutions of the following query: given a range [lr] as the input, report \(\max _{i, j \in \{l,\ldots ,r\}} |\mathsf {LCP}(S_{i}, S_j)|\). Here \(\mathsf {LCP}(S_i, S_j)\) is the longest common prefix of the suffixes of S starting at locations i and j and \(|\mathsf {LCP}(S_i,S_j)|\) is its length. We study a natural extension of this problem, where the query consists of two ranges. Additionally, we allow a bounded number (say \(k\ge 0\)) of mismatches in the \(\mathsf {LCP}\) computation. Specifically, our task is to report the following when two ranges \([\ell _1, r_1]\) and \([\ell _2,r_2]\) comes as input:

$$\max _{\{\ell _1\le i\le r_1, \ell _2\le j\le r_2\}}|\mathsf {LCP}_k(S_i,S_j)|$$

Here \(\mathsf {LCP}_k(S_i,S_j)\) is the longest prefix of \(S_i\) and \(S_j\) with at most k mismatches allowed. We show that the queries can be answered in O(k) time using an \(O(n^2/w)\) space data structure, where w is the word size. We also present space efficient data structures for \(k=0\) and \(k=1\). For \(k=0\), we obtain a linear space data structure with query time \(O(\sqrt{n/w}\log ^{\epsilon } n)\), where w is the word size and \(\epsilon >0\) is an arbitrarily small constant.

For the case \(k=1\) we obtain an \(O(n\log n)\) space data structure with query time \(O(\sqrt{n}\log n)\).

Finally, we give a reduction from Set Intersection to Range LCP queries, suggesting that it will be very difficult to improve our upper bound by more than a factor of \(O(\log ^{\epsilon }n)\).

A. Amir—Partly supported by ISF grant 571/14.

M. Lewenstein—Partly supported by GIF 1147/2011 and BSF 2010437.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Amir, A., Apostolico, A., Landau, G.M., Levy, A., Lewenstein, M., Porat, E.: Range LCP. J. Comp. and Sys. Sci. 80(7), 1245–1253 (2014)

    Article  MathSciNet  MATH  Google Scholar 

  2. Brodal, G.S., Davoodi, P., Lewenstein, M., Raman, R., Srinivasa Rao, S.: Two Dimensional Range Minimum Queries and Fibonacci Lattices. In: Epstein, L., Ferragina, P. (eds.) ESA 2012. LNCS, vol. 7501, pp. 217–228. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  3. Brodal, G.S., Davoodi, P., Rao, S.S.: On Space Efficient Two Dimensional Range Minimum Data Structures. In: de Berg, M., Meyer, U. (eds.) ESA 2010, Part II. LNCS, vol. 6347, pp. 171–182. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  4. Cohen, H., Porat, E.: Fast set intersection and two-patterns matching. Theor. Comput. Sci. 411(40–42), 3795–3800 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  5. Cole, R., Gottlieb, L., Lewenstein, M.: Dictionary matching and indexing with errors and don’t cares. In: Proc. 36th Annual ACM Symposium on the Theory of Computing (STOC), pp. 91–100. ACM Press (2004)

    Google Scholar 

  6. Cormode, G., Muthukrishnan, S.: Substring compression problems. In: Proc. 16th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 321–330 (2005)

    Google Scholar 

  7. Dietz, P., Mehlhorn, K., Raman, R., Uhrig, C.: Lower bounds for set intersection queries. Algorithmica 14(2), 154–168 (1995)

    Article  MathSciNet  MATH  Google Scholar 

  8. Galil, Z., Giancarlo, R.: Improved string matching with \(k\) mismatches. SIGACT News 17(4), 52–54 (1986)

    Article  Google Scholar 

  9. Harel, D., Tarjan, R.E.: Fast algorithms for finding nearest common ancestor. Computer and System Science 13, 338–355 (1984)

    MathSciNet  MATH  Google Scholar 

  10. Kärkkäinen, J., Sanders, P.: Simple linear work suffix array construction. In: Baeten, J.C.M. et al., (eds.): ICALP 2003. LNCS, vol. 2719, pp. 943–955. Springer, Heidelberg (2003)

    Google Scholar 

  11. Kasai, T., Lee, G.H., Arimura, H., Arikawa, S., Park, K.: Linear-Time Longest-Common-Prefix Computation in Suffix Arrays and Its Applications. In: Amir, A., Landau, G.M. (eds.) CPM 2001. LNCS, vol. 2089, pp. 181–192. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  12. Keller, O., Kopelowitz, T.: Shir Landau Feibish, and Moshe Lewenstein, Generalized substring compression. Theor. Comput. Sci. 525, 42–54 (2014)

    Article  MathSciNet  MATH  Google Scholar 

  13. Landau, G.M., Vishkin, U.: Fast parallel and serial approximate string matching. Journal of Algorithms 10(2), 157–169 (1989)

    Article  MathSciNet  MATH  Google Scholar 

  14. Landau, G.M., Vishkin, U.: Efficient string matching in the presence of errors. In: Proc. 26th IEEE FOCS, pp. 126–126 (1985)

    Google Scholar 

  15. Lempel, A., Ziv, J.: On the complexity of finite sequences. IEEE Transactions on Information Theory 22, 75–81 (1976)

    Article  MathSciNet  MATH  Google Scholar 

  16. Lewenstein, M.: Orthogonal Range Searching for Text Indexing. In: Brodnik, A., López-Ortiz, A., Raman, V., Viola, A. (eds.) Ianfest-66. LNCS, vol. 8066, pp. 267–302. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  17. Makalowski, W., Pande, A., Gotea, V., Makalowska, I.: Transposable elements and their identification. Methods Mol. Biol. 855, 337–359 (2012)

    Article  Google Scholar 

  18. McClintock, B.: The origin and behavior of multiple loci in maize. Proc. Natl. Acad. Sci. 36(6), 344–355 (1950)

    Article  Google Scholar 

  19. Patil, M., Shah, R., Thankachan, S.V.: Faster Range LCP Queries. In: Kurland, O., Lewenstein, M., Porat, E. (eds.) SPIRE 2013. LNCS, vol. 8214, pp. 263–270. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  20. Weiner, P.: Linear pattern matching algorithm. In: Proc. 14 IEEE Symposium on Switching and Automata Theory, 1–11 (1973)

    Google Scholar 

  21. Yellin, D.: Data structures for set equality-testing. In: Proc. 9th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 386–392 (1992)

    Google Scholar 

  22. Yuan, H., Atallah, M.J.: Data structures for range minimum queries in multidimensional arrays. In: Proc. 21st ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 150–160 (2010)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Moshe Lewenstein .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this paper

Cite this paper

Amir, A., Lewenstein, M., Thankachan, S.V. (2015). Range LCP Queries Revisited. In: Iliopoulos, C., Puglisi, S., Yilmaz, E. (eds) String Processing and Information Retrieval. SPIRE 2015. Lecture Notes in Computer Science(), vol 9309. Springer, Cham. https://doi.org/10.1007/978-3-319-23826-5_33

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-23826-5_33

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-23825-8

  • Online ISBN: 978-3-319-23826-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics