Skip to main content

Reconstructing Parameterized Strings from Parameterized Suffix and LCP Arrays

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

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 13617))

Included in the following conference series:

  • 392 Accesses

Abstract

Reconstructing input from a data structure entails determining whether an instance of the data structure is in fact valid or not, and if valid, discovering the underlying data that it represents. In this paper we consider the parameterized suffix array (pSA) along with its corresponding parameterized longest-common-prefix (pLCP) array and solve the following problem. Given two arrays of numbers as input, A and P, does there exist a parameterized string S such that A is its pSA and P is its pLCP array? If the answer is positive, our algorithm produces a string S whose pSA is A and whose pLCP array is P. Although the naive approach would have to consider an exponential number of possibilities for such a string S, our algorithm’s time complexity is only \(O(n^2)\) for input arrays of size n.

A. Amir—Partially supported by Grant No. 2018141 from the United States-Israel Binational Science Foundation (BSF) and Israel Science Foundation Grant 1475-18.

C. Guerra—Partially supported by BSF Grant No. 2018141.

G. M. Landau—Partially supported by Grant No. 2018141 from the United States-Israel Binational Science Foundation (BSF) and Israel Science Foundation Grant 1475-18.

D. Sokol—Partially supported by BSF Grant No. 2018141.

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. Amir, A., Aumann, A., Lewenstein, M., Porat, E.: Function matching. SIAM J. Comput. 35(5), 1007–1022 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  2. Amir, A., Benson, G., Farach, M.: An alphabet independent approach to two dimensional pattern matching. SIAM J. Comp. 23(2), 313–323 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  3. Amir, A., Church, K.W., Dar, E.: Separable attributes: a technique for solving the submatrices character count problem. In: Proceedings 13th ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 400–401 (2002)

    Google Scholar 

  4. Amir, A., Farach, M., Muthukrishnan, S.: Alphabet dependence in parameterized matching. Inf. Process. Lett. 49(3), 111–115 (1994). https://doi.org/10.1016/0020-0190(94)90086-8

    Article  MATH  Google Scholar 

  5. Amir, A., Kondratovsky, E.: Sufficient conditions for efficient indexing under different matchings. In: Pisanti, N., Pissis, S.P. (eds.) 30th Annual Symposium on Combinatorial Pattern Matching, CPM 2019, 18–20 June 2019, Pisa, Italy. LIPIcs, vol. 128, pp. 6:1–6:12. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2019). https://doi.org/10.4230/LIPIcs.CPM.2019.6

  6. Amir, A., Kondratovsky, E.: Towards a real time algorithm for parameterized longest common prefix computation. Theor. Comput. Sci. 852, 132–137 (2021). https://doi.org/10.1016/j.tcs.2020.11.023

    Article  MathSciNet  MATH  Google Scholar 

  7. Apostolico, A., Erdös, P.L., Lewenstein, M.: Parameterized matching with mismatches. J. Discrete Algorithms 5(1), 135–140 (2007). https://doi.org/10.1016/j.jda.2006.03.014

    Article  MathSciNet  MATH  Google Scholar 

  8. Babu, G., Mehtre, B., Kankanhalli, M.: Color indexing for efficient image retrieval. Multimedia Tools Appl. 1(4), 327–348 (1995)

    Article  Google Scholar 

  9. Baker, B.S.: Parameterized pattern matching: algorithms and applications. J. Comput. Syst. Sci. 52(1), 28–42 (1996). https://doi.org/10.1006/jcss.1996.0003

    Article  MathSciNet  MATH  Google Scholar 

  10. Baker, B.S.: Parameterized duplication in strings: algorithms and an application to software maintenance. SIAM J. Comput. 26(5), 1343–1362 (1997). https://doi.org/10.1137/S0097539793246707

    Article  MathSciNet  MATH  Google Scholar 

  11. Bannai, H., Inenaga, S., Shinohara, A., Takeda, M.: Inferring strings from graphs and arrays. In: Rovan, B., Vojtáš, P. (eds.) MFCS 2003. LNCS, vol. 2747, pp. 208–217. Springer, Heidelberg (2003). https://doi.org/10.1007/978-3-540-45138-9_15

    Chapter  Google Scholar 

  12. Deguchi, S., Higashijima, F., Bannai, H., Inenaga, S., Takeda, M.: Parameterized suffix arrays for binary strings. In: Holub, J., Zdárek, J. (eds.) Proceedings of the Prague Stringology Conference 2008, Prague, Czech Republic, 1–3 September 2008, pp. 84–94. Prague Stringology Club, Department of Computer Science and Engineering, Faculty of Electrical Engineering, Czech Technical University in Prague (2008). http://www.stringology.org/event/2008/p08.html

  13. Duval, J., Lefebvre, A.: Words over an ordered alphabet and suffix permutations. RAIRO Theor. Inform. Appl. 36(3), 249–259 (2002). https://doi.org/10.1051/ita:2002012

    Article  MathSciNet  MATH  Google Scholar 

  14. Fujisato, N., Nakashima, Y., Inenaga, S., Bannai, H., Takeda, M.: Direct linear time construction of parameterized suffix and LCP arrays for constant alphabets. In: Brisaboa, N.R., Puglisi, S.J. (eds.) SPIRE 2019. LNCS, vol. 11811, pp. 382–391. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-32686-9_27

    Chapter  Google Scholar 

  15. Gabow, H.N., Bentley, J.L., Tarjan, R.E.: Scaling and related techniques for geometry problems. In: DeMillo, R.A. (ed.) Proceedings of the 16th Annual ACM Symposium on Theory of Computing, April 30 - May 2 1984, Washington, DC, USA, pp. 135–143. ACM (1984). https://doi.org/10.1145/800057.808675

  16. Harel, D., Tarjan, R.E.: Fast algorithms for finding nearest common ancestors. SIAM J. Comput. 13(2), 338–355 (1984). https://doi.org/10.1137/0213024

    Article  MathSciNet  MATH  Google Scholar 

  17. Hazay, C., Lewenstein, M., Sokol, D.: Approximate parameterized matching. In: Albers, S., Radzik, T. (eds.) ESA 2004. LNCS, vol. 3221, pp. 414–425. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-30140-0_38

    Chapter  Google Scholar 

  18. Idury, R.M., Schäffer, A.A.: Multiple matching of parameterized patterns. In: Crochemore, M., Gusfield, D. (eds.) CPM 1994. LNCS, vol. 807, pp. 226–239. Springer, Heidelberg (1994). https://doi.org/10.1007/3-540-58094-8_20

    Chapter  Google Scholar 

  19. Lee, T., Na, J.C., Park, K.: On-line construction of parameterized suffix trees. In: Karlgren, J., Tarhio, J., Hyyrö, H. (eds.) SPIRE 2009. LNCS, vol. 5721, pp. 31–38. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-03784-9_4

    Chapter  Google Scholar 

  20. Swain, M., Ballard, D.: Color indexing. Int. J. Comput. Vision 7(1), 11–32 (1991)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Shoshana Marcus .

Editor information

Editors and Affiliations

A Appendix

A Appendix

Fig. 1.
figure 1

(left) The input p-suffix and pLCP arrays. (center) The Left-Table is constructed with unknown placeholders representing mismatch at the end of the pLCPs depicted in red. (right) The Left-Table after using Algorithm  1 to resolve the unknowns in red and updating other occurrences of the same unknowns, to maintain consistency. (Color figure online)

Fig. 2.
figure 2

(left) We initially fill the Right-Table by copying p-suffixes from the Left-Table into their places in the Right-Table. The unknown placeholders we are able to resolve from context within their columns are shown in yellow. The remaining unknown placeholders are colored orange. (right) The completed Right-Table and two different possible p-strings corresponding to it. (Color figure online)

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

Amir, A., Guerra, C., Kondratovsky, E., Landau, G.M., Marcus, S., Sokol, D. (2022). Reconstructing Parameterized Strings from Parameterized Suffix and LCP Arrays. 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_5

Download citation

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

  • 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