String 2-Covers with No Length Restrictions

Authors Itai Boneh , Shay Golan , Arseny Shur



PDF
Thumbnail PDF

File

LIPIcs.ESA.2024.31.pdf
  • Filesize: 0.86 MB
  • 18 pages

Document Identifiers

Author Details

Itai Boneh
  • Reichman University, Herzliya, Israel
  • University of Haifa, Israel
Shay Golan
  • Reichman University, Herzliya, Israel
  • University of Haifa, Israel
Arseny Shur
  • Bar Ilan University, Ramat Gan, Israel

Acknowledgements

We are grateful to anonymous reviewers for careful reading and useful comments. Our special thanks for Mikhail Rubinchik and one of the reviewers for independently suggesting a faster algorithm for Lemma 34.

Cite AsGet BibTex

Itai Boneh, Shay Golan, and Arseny Shur. String 2-Covers with No Length Restrictions. In 32nd Annual European Symposium on Algorithms (ESA 2024). Leibniz International Proceedings in Informatics (LIPIcs), Volume 308, pp. 31:1-31:18, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2024)
https://doi.org/10.4230/LIPIcs.ESA.2024.31

Abstract

A λ-cover of a string S is a set of strings {C_i}₁^λ such that every index in S is contained in an occurrence of at least one string C_i. The existence of a 1-cover defines a well-known class of quasi-periodic strings. Quasi-periodicity can be decided in linear time, and all 1-covers of a string can be reported in linear time as well. Since in general it is NP-complete to decide whether a string has a λ-cover, the natural next step is the development of efficient algorithms for 2-covers. Radoszewski and Straszyński [ESA 2020] analysed the particular case where the strings in a 2-cover must be of the same length. They provided an algorithm that reports all such 2-covers of S in time near-linear in |S| and in the size of the output. In this work, we consider 2-covers in full generality. Since every length-n string has Ω(n²) trivial 2-covers (every prefix and suffix of total length at least n constitute such a 2-cover), we state the reporting problem as follows: given a string S and a number m, report all 2-covers {C₁,C₂} of S with length |C₁|+|C₂| upper bounded by m. We present an Õ(n + output) time algorithm solving this problem, with output being the size of the output. This algorithm admits a simpler modification that finds a 2-cover of minimum length. We also provide an Õ(n) time construction of a 2-cover oracle which, given two substrings C₁,C₂ of S, reports in poly-logarithmic time whether {C₁,C₂} is a 2-cover of S.

Subject Classification

ACM Subject Classification
  • Theory of computation → Design and analysis of algorithms
Keywords
  • Quasi-periodicity
  • String cover
  • Range query
  • Range stabbing

Metrics

  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    0
    PDF Downloads

References

  1. Ali Alatabbi, M. Sohel Rahman, and W. F. Smyth. Computing covers using prefix tables. Discret. Appl. Math., 212:2-9, 2016. URL: https://doi.org/10.1016/J.DAM.2015.05.019.
  2. Amihood Amir, Avivit Levy, Moshe Lewenstein, Ronit Lubin, and Benny Porat. Can we recover the cover? Algorithmica, 81(7):2857-2875, 2019. URL: https://doi.org/10.1007/S00453-019-00559-8.
  3. Amihood Amir, Avivit Levy, Ronit Lubin, and Ely Porat. Approximate cover of strings. Theor. Comput. Sci., 793:59-69, 2019. URL: https://doi.org/10.1016/J.TCS.2019.05.020.
  4. Alberto Apostolico and Andrzej Ehrenfeucht. Efficient detection of quasiperiodicities in strings. Theoretical Computer Science, 119(2):247-265, 1993. URL: https://doi.org/10.1016/0304-3975(93)90159-Q.
  5. Hideo Bannai, Tomohiro I, Shunsuke Inenaga, Yuto Nakashima, Masayuki Takeda, and Kazuya Tsuruta. The "runs" theorem. SIAM J. Comput., 46(5):1501-1514, 2017. URL: https://doi.org/10.1137/15M1011032.
  6. Carl Barton, Tomasz Kociumaka, Chang Liu, Solon P. Pissis, and Jakub Radoszewski. Indexing weighted sequences: Neat and efficient. Inf. Comput., 270, 2020. URL: https://doi.org/10.1016/J.IC.2019.104462.
  7. Omer Berkman, Costas S. Iliopoulos, and Kunsoo Park. The subtree max gap problem with application to parallel string covering. Inf. Comput., 123(1):127-137, 1995. URL: https://doi.org/10.1006/INCO.1995.1162.
  8. Itai Boneh, Shay Golan, and Arseny M. Shur. String 2-covers with no length restrictions. CoRR, abs/2405.11475, 2024. URL: https://doi.org/10.48550/arXiv.2405.11475.
  9. Dany Breslauer. An on-line string superprimitivity test. Inf. Process. Lett., 44(6):345-347, 1992. URL: https://doi.org/10.1016/0020-0190(92)90111-8.
  10. Bernard Chazelle. A functional approach to data structures and its use in multidimensional searching. SIAM J. Comput., 17(3):427-462, 1988. URL: https://doi.org/10.1137/0217026.
  11. Richard Cole, CS Ilopoulos, Manal Mohamed, William F Smyth, and Lu Yang. The complexity of the minimum k-cover problem. Journal of Automata, Languages and Combinatorics, 10(5-6):641-653, 2005. Google Scholar
  12. Patryk Czajka and Jakub Radoszewski. Experimental evaluation of algorithms for computing quasiperiods. Theoretical Computer Science, 854:17-29, 2021. Google Scholar
  13. Jonas Ellert, Pawel Gawrychowski, and Garance Gourdel. Optimal square detection over general alphabets. In Nikhil Bansal and Viswanath Nagarajan, editors, Proceedings of the 2023 ACM-SIAM Symposium on Discrete Algorithms, SODA 2023, Florence, Italy, January 22-25, 2023, pages 5220-5242. SIAM, 2023. URL: https://doi.org/10.1137/1.9781611977554.CH189.
  14. Zvi Galil and Raffaele Giancarlo. Data structures and algorithms for approximate string matching. Journal of Complexity, 4(1):33-72, 1988. URL: https://doi.org/10.1016/0885-064X(88)90008-8.
  15. Pawel Gawrychowski, Jakub Radoszewski, and Tatiana Starikovskaya. Quasi-periodicity in streams. In Nadia Pisanti and Solon P. Pissis, editors, 30th Annual Symposium on Combinatorial Pattern Matching, CPM 2019, June 18-20, 2019, Pisa, Italy, volume 128 of LIPIcs, pages 22:1-22:14. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2019. URL: https://doi.org/10.4230/LIPICS.CPM.2019.22.
  16. Qing Guo, Hui Zhang, and Costas S Iliopoulos. Computing the λ-covers of a string. Information Sciences, 177(19):3957-3967, 2007. Google Scholar
  17. Donald E. Knuth, James H. Morris Jr., and Vaughan R. Pratt. Fast pattern matching in strings. SIAM J. Comput., 6(2):323-350, 1977. Google Scholar
  18. Tomasz Kociumaka, Solon P. Pissis, Jakub Radoszewski, Wojciech Rytter, and Tomasz Walen. Fast algorithm for partial covers in words. Algorithmica, 73(1):217-233, 2015. URL: https://doi.org/10.1007/S00453-014-9915-3.
  19. Tomasz Kociumaka, Jakub Radoszewski, Wojciech Rytter, and Tomasz Walen. Optimal data structure for internal pattern matching queries in a text and applications. CoRR, abs/1311.6235, 2013. URL: https://arxiv.org/abs/1311.6235.
  20. Gad M. Landau and Uzi Vishkin. Fast string matching with k differences. Journal of Computer and System Sciences, 37(1):63-78, 1988. URL: https://doi.org/10.1016/0022-0000(88)90045-1.
  21. Laurentius Leonard and Ken Tanaka. Suffix tree-based linear algorithms for multiple prefixes, single suffix counting and listing problems. CoRR, abs/2203.16908, 2022. URL: https://arxiv.org/abs/2203.16908.
  22. Yin Li and William F. Smyth. Computing the cover array in linear time. Algorithmica, 32:95-106, 2002. Google Scholar
  23. Dennis Moore and W.F. Smyth. An optimal algorithm to compute all the covers of a string. Information Processing Letters, 50(5):239-246, 1994. URL: https://doi.org/10.1016/0020-0190(94)00045-X.
  24. Dennis Moore and W.F. Smyth. A correction to “an optimal algorithm to compute all the covers of a string”. Information Processing Letters, 54(2):101-103, 1995. URL: https://doi.org/10.1016/0020-0190(94)00235-Q.
  25. Alexandru Popa and Andrei Tanasescu. An output-sensitive algorithm for the minimization of 2-dimensional string covers. In T. V. Gopal and Junzo Watada, editors, Theory and Applications of Models of Computation - 15th Annual Conference, TAMC 2019, Kitakyushu, Japan, April 13-16, 2019, Proceedings, volume 11436 of Lecture Notes in Computer Science, pages 536-549. Springer, 2019. URL: https://doi.org/10.1007/978-3-030-14812-6_33.
  26. Jakub Radoszewski and Juliusz Straszyński. Efficient computation of 2-covers of a string. In 28th Annual European Symposium on Algorithms (ESA 2020). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2020. Google Scholar
  27. Mikhail Rubinchik and Arseny M. Shur. Counting palindromes in substrings. In Gabriele Fici, Marinella Sciortino, and Rossano Venturini, editors, String Processing and Information Retrieval - 24th International Symposium, SPIRE 2017, Proceedings, volume 10508 of Lecture Notes in Computer Science, pages 290-303. Springer, 2017. Google Scholar
  28. Dan E. Willard. New data structures for orthogonal range queries. SIAM J. Comput., 14(1):232-253, 1985. URL: https://doi.org/10.1137/0214019.
Questions / Remarks / Feedback
X

Feedback for Dagstuhl Publishing


Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail