skip to main content
research-article
Free Access
Just Accepted

An Improved Algorithm for The k-Dyck Edit Distance Problem

Online AM:19 October 2023Publication History
Skip Abstract Section

Abstract

A Dyck sequence is a sequence of opening and closing parentheses (of various types) that is balanced. The Dyck edit distance of a given sequence of parentheses S is the smallest number of edit operations (insertions, deletions, and substitutions) needed to transform S into a Dyck sequence. We consider the threshold Dyck edit distance problem, where the input is a sequence of parentheses S and a positive integer k, and the goal is to compute the Dyck edit distance of S only if the distance is at most k, and otherwise report that the distance is larger than k. Backurs and Onak [PODS’16] showed that the threshold Dyck edit distance problem can be solved in O(n + k16) time.

In this work, we design new algorithms for the threshold Dyck edit distance problem which costs O(n + k4.544184) time with high probability or O(n + k4.853059) deterministically. Our algorithms combine several new structural properties of the Dyck edit distance problem, a refined algorithm for fast (min , +) matrix product, and a careful modification of ideas used in Valiant’s parsing algorithm.

References

  1. Amir Abboud, Arturs Backurs, and Virginia Vassilevska Williams. 2015. If the Current Clique Algorithms are Optimal, So is Valiant’s Parser. In FOCS 2015. 98–117. https://doi.org/10.1109/FOCS.2015.16Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Alfred V. Aho and Thomas G. Peterson. 1972. A Minimum Distance Error-Correcting Parser for Context-Free Languages. SIAM J. Comput. 1, 4 (1972), 305–312. https://doi.org/10.1137/0201022Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Josh Alman and Virginia Vassilevska Williams. 2021. A Refined Laser Method and Faster Matrix Multiplication. In SODA 2021. 522–539. https://doi.org/10.1137/1.9781611976465.32Google ScholarGoogle ScholarCross RefCross Ref
  4. Noga Alon, Zvi Galil, and Oded Margalit. 1997. On the Exponent of the All Pairs Shortest Path Problem. J. Comput. Syst. Sci. 54, 2 (1997), 255–262. https://doi.org/10.1006/jcss.1997.1388Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Arturs Backurs and Krzysztof Onak. 2016. Fast Algorithms for Parsing Sequences of Parentheses with Few Errors. In PODS 2016. 477–488. https://doi.org/10.1145/2902251.2902304Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Karl Bringmann, Fabrizio Grandoni, Barna Saha, and Virginia Vassilevska Williams. 2019. Truly Subcubic Algorithms for Language Edit Distance and RNA Folding via Fast Bounded-Difference Min-Plus Product. SIAM J. Comput. 48, 2 (2019), 481–512. https://doi.org/10.1137/17M112720XGoogle ScholarGoogle ScholarDigital LibraryDigital Library
  7. Shucheng Chi, Ran Duan, and Tianle Xie. 2022. Faster Algorithms for Bounded-Difference Min-Plus Product. In SODA 2022. 1435–1447. https://doi.org/10.1137/1.9781611977073.60Google ScholarGoogle Scholar
  8. Shucheng Chi, Ran Duan, Tianle Xie, and Tianyi Zhang. 2022. Faster Min-plus Product for Monotone Instances. (2022), 1529–1542. https://doi.org/10.1145/3519935.3520057Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Noam Chomsky and Marcel Paul Schützenberger. 1963. The Algebraic Theory of Context-Free Languages. Studies in Logic (1963). https://doi.org/10.1016/s0049-237x(08)72023-8Google ScholarGoogle Scholar
  10. Debarati Das, Tomasz Kociumaka, and Barna Saha. 2022. Improved Approximation Algorithms for Dyck Edit Distance and RNA Folding. In ICALP 2022, Vol.  229. 49:1–49:20. https://doi.org/10.4230/LIPIcs.ICALP.2022.49Google ScholarGoogle Scholar
  11. Mark de Berg, Otfried Cheong, Marc J. van Kreveld, and Mark H. Overmars. 2008. Computational geometry: algorithms and applications, 3rd Edition. Springer. https://www.worldcat.org/oclc/227584184Google ScholarGoogle ScholarCross RefCross Ref
  12. Anita Dürr. 2022. Improved Bounds for Rectangular Monotone Min-Plus Product. https://doi.org/10.48550/ARXIV.2208.02862Google ScholarGoogle Scholar
  13. Johannes Fischer and Volker Heun. 2006. Theoretical and Practical Improvements on the RMQ-Problem, with Applications to LCA and LCE. In Combinatorial Pattern Matching. 36–48. https://doi.org/10.1007/11780441_5Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Francois Le Gall and Florent Urrutia. 2018. Improved Rectangular Matrix Multiplication using Powers of the Coppersmith-Winograd Tensor. In SODA 2018. 1029–1046. https://doi.org/10.1137/1.9781611975031.67Google ScholarGoogle ScholarCross RefCross Ref
  15. Robin R. Gutell, Jamie Cannone, Zhidi Shang, Yushi Du, and Martin J. Serra. 2000. A story: unpaired adenosine bases in ribosomal RNAs. Journal of Molecular Biology 304, 3 (2000), 335–354. https://doi.org/10.1006/jmbi.2000.4172Google ScholarGoogle ScholarCross RefCross Ref
  16. Michael A. Harrison. 1978. Introduction to Formal Language Theory. Addison-Wesley Longman Publishing Co., Boston, MA, USA, 1st edition.Google ScholarGoogle Scholar
  17. Rajesh Jayaram and Barna Saha. 2017. Approximating Language Edit Distance Beyond Fast Matrix Multiplication: Ultralinear Grammars Are Where Parsing Becomes Hard!. In ICALP 2017(Leibniz International Proceedings in Informatics (LIPIcs), Vol.  80). 19:1–19:15. https://doi.org/10.4230/LIPIcs.ICALP.2017.19Google ScholarGoogle Scholar
  18. Dexter C. Kozen. 1997. Automata and Computability(1st ed.). Springer-Verlag, Berlin, Heidelberg.Google ScholarGoogle Scholar
  19. Andreas Krebs, Nutan Limaye, and Srikanth Srinivasan. 2011. Streaming Algorithms for Recognizing Nearly Well-Parenthesized Expressions. In MFCS 2011. 412–423. https://doi.org/10.1007/978-3-642-22993-0_38Google ScholarGoogle Scholar
  20. Gad M. Landau, Eugene W. Myers, and Jeanette P. Schmidt. 1998. Incremental String Comparison. SIAM J. Comput. 27, 2 (1998), 557–582. https://doi.org/10.1137/S0097539794264810Google ScholarGoogle ScholarCross RefCross Ref
  21. Gad M. Landau and Uzi Vishkin. 1988. Fast String Matching with k Differences. J. Comput. System Sci. 37, 1 (1988), 63–78. https://doi.org/10.1016/0022-0000(88)90045-1Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Lillian Lee. 2002. Fast Context-Free Grammar Parsing Requires Fast Boolean Matrix Multiplication. J. ACM 49, 1 (Jan. 2002), 1–15. https://doi.org/10.1145/505241.505242Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. J. Ian Munro and Venkatesh Raman. 2001. Succinct Representation of Balanced Parentheses and Static Trees. SIAM J. Comput. 31, 3 (2001), 762–776. https://doi.org/10.1137/S0097539799364092Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Gene Myers. 1995. Approximately matching context-free languages. Inform. Process. Lett. 54, 2 (1995), 85–92. https://doi.org/10.1016/0020-0190(95)00007-yGoogle ScholarGoogle ScholarDigital LibraryDigital Library
  25. Alexander Okhotin. 2014. Parsing by matrix multiplication generalized to Boolean grammars. Theoretical Computer Science 516 (2014), 101–120. https://doi.org/10.1016/j.tcs.2013.09.011Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Sanguthevar Rajasekaran, Sahar Al Seesi, and Reda Ammar. 2009. Improved Algorithms for Parsing ESLTAGs: A Grammatical Model Suitable for RNA Pseudoknots. In Bioinformatics Research and Applications. 135–147. https://doi.org/10.1007/978-3-642-01551-9_14Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Barna Saha. 2014. The Dyck Language Edit Distance Problem in Near-Linear Time. In FOCS 2014. 611–620. https://doi.org/10.1109/FOCS.2014.71Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Barna Saha. 2015. Language Edit Distance and Maximum Likelihood Parsing of Stochastic Grammars: Faster Algorithms and Connection to Fundamental Graph Problems. In FOCS 2015. 118–135. https://doi.org/10.1109/FOCS.2015.17Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Barna Saha. 2017. Fast Space-Efficient Approximations of Language Edit Distance and RNA Folding: An Amnesic Dynamic Programming Approach. In FOCS 2017. 295–306. https://doi.org/10.1109/FOCS.2017.35Google ScholarGoogle Scholar
  30. Leslie G. Valiant. 1975. General Context-Free Recognition in Less than Cubic Time. J. Comput. Syst. Sci. 10, 2 (1975), 308–315. https://doi.org/10.1016/S0022-0000(75)80046-8Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Virginia Vassilevska Williams and Yinzhan Xu. 2020. Truly Subcubic Min-Plus Product for Less Structured Matrices, with Applications. In SODA 2020. SIAM, 12–29. https://doi.org/10.1137/1.9781611975994.2Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. An Improved Algorithm for The k-Dyck Edit Distance Problem

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM Transactions on Algorithms
      ACM Transactions on Algorithms Just Accepted
      ISSN:1549-6325
      EISSN:1549-6333
      Table of Contents

      Copyright © 2023 Copyright held by the owner/author(s).

      Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for third-party components of this work must be honored. For all other uses, contact the owner/author(s).

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Online AM: 19 October 2023
      • Accepted: 3 September 2023
      • Revised: 14 June 2023
      • Received: 8 June 2022
      Published in talg Just Accepted

      Check for updates

      Qualifiers

      • research-article
    • Article Metrics

      • Downloads (Last 12 months)65
      • Downloads (Last 6 weeks)10

      Other Metrics

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader