A Textbook Solution for Dynamic Strings

Authors Zsuzsanna Lipták , Francesco Masillo , Gonzalo Navarro



PDF
Thumbnail PDF

File

LIPIcs.ESA.2024.86.pdf
  • Filesize: 0.75 MB
  • 16 pages

Document Identifiers

Author Details

Zsuzsanna Lipták
  • Dipartimento di Informatica, University of Verona, Italy
Francesco Masillo
  • Dipartimento di Informatica, University of Verona, Italy
Gonzalo Navarro
  • Center for Biotechnology and Bioengineering (CeBiB), Department of Computer Science, University of Chile, Chile

Cite AsGet BibTex

Zsuzsanna Lipták, Francesco Masillo, and Gonzalo Navarro. A Textbook Solution for Dynamic Strings. In 32nd Annual European Symposium on Algorithms (ESA 2024). Leibniz International Proceedings in Informatics (LIPIcs), Volume 308, pp. 86:1-86:16, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2024)
https://doi.org/10.4230/LIPIcs.ESA.2024.86

Abstract

We consider the problem of maintaining a collection of strings while efficiently supporting splits and concatenations on them, as well as comparing two substrings, and computing the longest common prefix between two suffixes. This problem can be solved in optimal time O(log N) whp for the updates and O(1) worst-case time for the queries, where N is the total collection size [Gawrychowski et al., SODA 2018]. We present here a much simpler solution based on a forest of enhanced splay trees (FeST), where both the updates and the substring comparison take O(log n) amortized time, n being the lengths of the strings involved. The longest common prefix of length 𝓁 is computed in O(log n + log²𝓁) amortized time. Our query results are correct whp. Our simpler solution enables other more general updates in O(log n) amortized time, such as reversing a substring and/or mapping its symbols. We can also regard substrings as circular or as their omega extension.

Subject Classification

ACM Subject Classification
  • Theory of computation → Data structures design and analysis
Keywords
  • dynamic strings
  • splay trees
  • dynamic data structures
  • LCP
  • circular strings

Metrics

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

References

  1. Stephen Alstrup, Gerth Stølting Brodal, and Theis Rauhe. Pattern matching in dynamic texts. In Proc. 11th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 819-828, 2000. Google Scholar
  2. Lorraine A.K. Ayad and Solon P. Pissis. MARS: Improving multiple circular sequence alignment using refined sequences. BMC Genomics, 18(1):1-10, 2017. Google Scholar
  3. Vineet Bafna and Pavel A. Pevzner. Genome rearrangements and sorting by reversals. In Proc. 34th Annual Symposium on Foundations of Computer Science (FOCS), pages 148-157, 1993. Google Scholar
  4. Hans-Juergen Boehm, Russell R. Atkinson, and Michael F. Plass. Ropes: An alternative to strings. Software Practice and Experience, 25(12):1315-1330, 1995. Google Scholar
  5. Christina Boucher, Davide Cenzato, Zsuzsanna Lipták, Massimiliano Rossi, and Marinella Sciortino. Computing the original eBWT faster, simpler, and with less memory. In Proc. 28th International Symposium on String Processing and Information Retrieval (SPIRE), pages 129-142, 2021. Google Scholar
  6. Christina Boucher, Davide Cenzato, Zsuzsanna Lipták, Massimiliano Rossi, and Marinella Sciortino. r-indexing the eBWT. Information and Computation, 298:105155, 2024. URL: https://doi.org/10.1016/j.ic.2024.105155.
  7. Alberto Caprara. Sorting by reversals is difficult. In Proc. 1st Annual International Conference on Research in Computational Molecular Biology (RECOMB), pages 75-83, 1997. Google Scholar
  8. Alberto Caprara and Romeo Rizzi. Improved approximation for breakpoint graph decomposition and sorting by reversals. Journal of Combinatorial Optimization, 6(2):157-182, 2002. Google Scholar
  9. Jean Cardinal and John Iacono. Modular subset sum, dynamic strings, and zero-sum sets. In Proc. 4th Symposium on Simplicity in Algorithms (SOSA), pages 45-56. SIAM, 2021. Google Scholar
  10. Giulio Cerbai and Luca S. Ferrari. Permutation patterns in genome rearrangement problems: The reversal model. Discrete Applied Mathematics, 279:34-48, 2020. Google Scholar
  11. Panagiotis Charalampopoulos, Tomasz Kociumaka, Jakub Radoszewski, Solon P. Pissis, Wojciech Rytter, Tomasz Walen, and Wiktor Zuba. Approximate circular pattern matching. In Proc. 30th Annual European Symposium on Algorithms (ESA), pages 35:1-35:19, 2022. Google Scholar
  12. M. Charikar, E. Lehman, D. Liu, R. Panigrahy, M. Prabhakaran, A. Sahai, and A. Shelat. The smallest grammar problem. IEEE Transactions on Information Theory, 51(7):2554-2576, 2005. Google Scholar
  13. Richard Cole. On the dynamic finger conjecture for splay trees. Part II: The proof. SIAM Journal on Computing, 30(1):44-85, 2000. Google Scholar
  14. James R. Driscoll, Neil Sarnak, Daniel Dominic Sleator, and Robert Endre Tarjan. Making data structures persistent. In Proc. 18th Annual ACM Symposium on Theory of Computing (STOC), pages 109-121, 1986. Google Scholar
  15. Guillaume Fertin, Anthony Labarre, Irena Rusu, Eric Tannier, and Stéphane Vialette. Combinatorics of Genome Rearrangements. MIT Press, 2009. Google Scholar
  16. Pawel Gawrychowski. Pattern matching in Lempel-Ziv compressed strings: Fast, simple, and deterministic. In Proc. 19th Annual European Symposium on Algorithms (ESA), pages 421-432, 2011. Google Scholar
  17. Pawel Gawrychowski, Adam Karczmarz, Tomasz Kociumaka, Jakub Lacki, and Piotr Sankowski. Optimal dynamic strings. CoRR, abs/1511.02612, 2015. Google Scholar
  18. Pawel Gawrychowski, Adam Karczmarz, Tomasz Kociumaka, Jakub Lacki, and Piotr Sankowski. Optimal dynamic strings. In Proc. 29th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 1509-1528, 2018. Google Scholar
  19. Roberto Grossi, Costas S. Iliopoulos, Jesper Jansson, Zara Lim, Wing-Kin Sung, and Wiktor Zuba. Finding the cyclic covers of a string. In Proc. 17th International Conference and Workshops on Algorithms and Computation (WALCOM), pages 139-150, 2023. Google Scholar
  20. Roberto Grossi, Costas S Iliopoulos, Robert Mercas, Nadia Pisanti, Solon P Pissis, Ahmad Retha, and Fatima Vayani. Circular sequence comparison: algorithms and applications. Algorithms for Molecular Biology, 11(1):1-14, 2016. Google Scholar
  21. Yijie Han. Improving the efficiency of sorting by reversals. In Proc. International Conference on Bioinformatics & Computational Biology (BIOCOMP), pages 406-409, 2006. Google Scholar
  22. Sridhar Hannenhalli and Pavel A. Pevzner. Transforming cabbage into turnip: Polynomial algorithm for sorting signed permutations by reversals. In Proc. 27th Annual ACM Symposium on Theory of Computing (STOC), pages 178-189, 1995. Google Scholar
  23. Costas S. Iliopoulos, Tomasz Kociumaka, Jakub Radoszewski, Wojciech Rytter, Tomasz Walen, and Wiktor Zuba. Linear-time computation of cyclic roots and cyclic covers of a string. In Proc. 34th Annual Symposium on Combinatorial Pattern Matching (CPM), pages 15:1-15:15, 2023. Google Scholar
  24. Richard M. Karp and Michael O. Rabin. Efficient randomized pattern-matching algorithms. IBM Journal of Research and Development, 31(2):249-260, 1987. Google Scholar
  25. Dominik Kempa and Ben Langmead. Fast and space-efficient construction of AVL grammars from the LZ77 parsing. CoRR, 2105.11052, 2021. Google Scholar
  26. D. E. Knuth. The Art of Computer Programming, volume 3: Sorting and Searching. Addison-Wesley, 2nd edition, 1998. Google Scholar
  27. Sabrina Mantaci, Antonio Restivo, Giovanna Rosone, and Marinella Sciortino. An extension of the Burrows-Wheeler transform. Theoretical Computer Science, 387(3):298-312, 2007. Google Scholar
  28. Kurt Mehlhorn, Rajamani Sundar, and Christian Uhrig. Maintaining dynamic sequences under equality tests in polylogarithmic time. Algorithmica, 17(2):183-198, 1997. Google Scholar
  29. Kevin Menard, Chris Seaton, and Benoit Daloze. Specializing ropes for ruby. In Proc. 15th International Conference on Managed Languages & Runtimes (ManLang), pages 10:1-10:7, 2018. Google Scholar
  30. Gonzalo Navarro and Nicola Prezza. Universal compressed text indexing. Theoretical Computer Science, 762:41-50, 2019. Google Scholar
  31. Takaaki Nishimoto, Tomohiro I, Shunsuke Inenaga, Hideo Bannai, and Masayuki Takeda. Fully dynamic data structure for LCE queries in compressed space. In Proc. 41st International Symposium on Mathematical Foundations of Computer Science (MFCS), pages 72:1-72:14, 2016. Google Scholar
  32. Takaaki Nishimoto, Tomohiro I, Shunsuke Inenaga, Hideo Bannai, and Masayuki Takeda. Dynamic index and LZ factorization in compressed space. Discrete Applied Mathematics, 274:116-129, 2020. Google Scholar
  33. Andre Rodrigues Oliveira, Ulisses Dias, and Zanoni Dias. On the sorting by reversals and transpositions problem. Journal of Universal Computer Science, 23(9):868-906, 2017. Google Scholar
  34. W. Rytter. Application of Lempel-Ziv factorization to the approximation of grammar-based compression. Theoretical Computer Science, 302(1-3):211-222, 2003. Google Scholar
  35. Daniel Dominic Sleator and Robert Endre Tarjan. Self-adjusting binary search trees. Journal of the ACM, 32(3):652-686, 1985. Google Scholar
  36. Rajamani Sundar and Robert E. Tarjan. Unique binary-search-tree representations and equality testing of sets and sequences. SIAM Journal on Computing, 23(1):24-44, 1994. Google Scholar
  37. Wojciech Szpankowski. A generalized suffix tree and its (un)expected asymptotic behaviors. SIAM Journal on Computing, 22(6):1176-1198, 1993. Google Scholar
  38. G.A. Watterson, W.J. Ewens, T.E. Hall, and A. Morgan. The chromosome inversion problem. Journal of Theoretical Biology, 99:1-7, 1982. Google Scholar
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