On Finding Longest Palindromic Subsequences Using Longest Common Subsequences

Authors Gerth Stølting Brodal , Rolf Fagerberg , Casper Moldrup Rysgaard



PDF
Thumbnail PDF

File

LIPIcs.ESA.2024.35.pdf
  • Filesize: 0.82 MB
  • 16 pages

Document Identifiers

Author Details

Gerth Stølting Brodal
  • Aarhus University, Denmark
Rolf Fagerberg
  • University of Southern Denmark, Odense, Denmark
Casper Moldrup Rysgaard
  • Aarhus University, Denmark

Cite AsGet BibTex

Gerth Stølting Brodal, Rolf Fagerberg, and Casper Moldrup Rysgaard. On Finding Longest Palindromic Subsequences Using Longest Common Subsequences. In 32nd Annual European Symposium on Algorithms (ESA 2024). Leibniz International Proceedings in Informatics (LIPIcs), Volume 308, pp. 35:1-35:16, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2024)
https://doi.org/10.4230/LIPIcs.ESA.2024.35

Abstract

Two standard textbook problems illustrating dynamic programming are to find the longest common subsequence (LCS) between two strings and to find the longest palindromic subsequence (LPS) of a single string. A popular claim is that the longest palindromic subsequence in a string can be computed as the longest common subsequence between the string and the reversed string. We prove that the correctness of this claim depends on how the longest common subsequence is computed. In particular, we prove that the classical dynamic programming solution by Wagner and Fischer [JACM 1974] for finding an LCS in fact does find an LPS, while a slightly different LCS backtracking strategy makes the algorithm fail to always report a palindrome.

Subject Classification

ACM Subject Classification
  • Theory of computation → Design and analysis of algorithms
Keywords
  • Palindromic subsequence
  • longest common subsequence
  • dynamic programming

Metrics

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

References

  1. Amir Abboud, Arturs Backurs, and Virginia Vassilevska Williams. Tight hardness results for LCS and other sequence similarity measures. In Venkatesan Guruswami, editor, IEEE 56th Annual Symposium on Foundations of Computer Science, FOCS 2015, Berkeley, CA, USA, 17-20 October, 2015, pages 59-78. IEEE Computer Society, 2015. URL: https://doi.org/10.1109/FOCS.2015.14.
  2. Alfred V. Aho, Daniel S. Hirschberg, and Jeffrey D. Ullman. Bounds on the complexity of the longest common subsequence problem. Journal of the ACM, 23(1):1-12, 1976. URL: https://doi.org/10.1145/321921.321922.
  3. Alberto Apostolico, Dany Breslauer, and Zvi Galil. Parallel detection of all palindromes in a string. Theoretical Computer Science, 141(1&2):163-173, 1995. URL: https://doi.org/10.1016/0304-3975(94)00083-U.
  4. Lasse Bergroth, Harri Hakonen, and Timo Raita. A survey of longest common subsequence algorithms. In Pablo de la Fuente, editor, Seventh International Symposium on String Processing and Information Retrieval, SPIRE 2000, A Coruña, Spain, September 27-29, 2000, pages 39-48. IEEE Computer Society, 2000. URL: https://doi.org/10.1109/SPIRE.2000.878178.
  5. Philip Bille and Martin Farach-Colton. Fast and compact regular expression matching. Theoretical Computer Science, 409(3):486-496, 2008. URL: https://doi.org/10.1016/J.TCS.2008.08.042.
  6. Karl Bringmann, Vincent Cohen-Addad, and Debarati Das. A linear-time n^0.4-approximation for longest common subsequence. ACM Transactions on Algorithms, 19(1):9:1-9:24, 2023. URL: https://doi.org/10.1145/3568398.
  7. Karl Bringmann and Marvin Künnemann. Quadratic conditional lower bounds for string problems and dynamic time warping. In Venkatesan Guruswami, editor, IEEE 56th Annual Symposium on Foundations of Computer Science, FOCS 2015, Berkeley, CA, USA, 17-20 October, 2015, pages 79-97. IEEE Computer Society, 2015. URL: https://doi.org/10.1109/FOCS.2015.15.
  8. Shihabur Rahman Chowdhury, Md. Mahbubul Hasan, Sumaiya Iqbal, and M. Sohel Rahman. Computing a longest common palindromic subsequence. In S. Arumugam and W. F. Smyth, editors, Combinatorial Algorithms, 23rd International Workshop, IWOCA 2012, Tamil Nadu, India, July 19-21, 2012, Revised Selected Papers, volume 7643 of Lecture Notes in Computer Science, pages 219-223. Springer, 2012. URL: https://doi.org/10.1007/978-3-642-35926-2_24.
  9. K. Chuang, R. Lee, and C. Huang. Finding all palindrome subsequences in a string. In The 24th Workshop on Combinatorial Mathematics and Computation Theory, 2007. Google Scholar
  10. V. Chvatal, D. A. Karner, and D.E. Knuth. Selected combinatorial research problems. Technical Report STAN-CS-72-292, Computer Science Department, Stanford University, June 1972. URL: http://i.stanford.edu/pub/cstr/reports/cs/tr/72/292/CS-TR-72-292.pdf.
  11. Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms, Fourth Edition. MIT Press, 2022. URL: https://mitpress.mit.edu/9780262046305.
  12. Maxime Crochemore and Wojciech Rytter. Jewels of stringology. World Scientific, 2002. URL: https://doi.org/10.1142/4838.
  13. Sanjoy Dasgupta, Christos H. Papadimitriou, and Umesh V. Vazirani. Algorithms. McGraw-Hill, 2006. URL: https://www.mheducation.com/highered/product/M9780073523408.html.
  14. Szymon Grabowski. New tabulation and sparse dynamic programming based techniques for sequence similarity problems. Discrete Applied Mathematics, 212:96-103, 2016. URL: https://doi.org/10.1016/J.DAM.2015.10.040.
  15. Dan Gusfield. Algorithms on Strings, Trees, and Sequences - Computer Science and Computational Biology. Cambridge University Press, 1997. URL: https://doi.org/10.1017/CBO9780511574931.
  16. Md. Mahbubul Hasan, A. S. M. Sohidull Islam, M. Sohel Rahman, and Ayon Sen. Palindromic subsequence automata and longest common palindromic subsequence. Mathematics in Computer Science, 11(2):219-232, 2017. URL: https://doi.org/10.1007/S11786-016-0288-7.
  17. Daniel S. Hirschberg. A linear space algorithm for computing maximal common subsequences. Communications of the ACM, 18(6):341-343, 1975. URL: https://doi.org/10.1145/360825.360861.
  18. Daniel S. Hirschberg. Algorithms for the longest common subsequence problem. Journal of the ACM, 24(4):664-675, 1977. URL: https://doi.org/10.1145/322033.322044.
  19. James W. Hunt and Thomas G. Szymanski. A fast algorithm for computing longest subsequences. Communications of the ACM, 20(5):350-353, 1977. URL: https://doi.org/10.1145/359581.359603.
  20. Shunsuke Inenaga and Heikki Hyyrö. A hardness result and new algorithm for the longest common palindromic subsequence problem. Information Processing Letters, 129:11-15, 2018. URL: https://doi.org/10.1016/J.IPL.2017.08.006.
  21. Roman Kolpakov and Gregory Kucherov. Searching for gapped palindromes. Theoretical Computer Science, 410(51):5365-5373, 2009. URL: https://doi.org/10.1016/J.TCS.2009.09.013.
  22. Glenn K. Manacher. A new linear-time "on-line" algorithm for finding the smallest initial palindrome of a string. J. ACM, 22(3):346-351, 1975. URL: https://doi.org/10.1145/321892.321896.
  23. William J. Masek and Mike Paterson. A faster algorithm computing string edit distances. Journal of Computer and System Sciences, 20(1):18-31, 1980. URL: https://doi.org/10.1016/0022-0000(80)90002-1.
  24. Narao Nakatsu, Yahiko Kambayashi, and Shuzo Yajima. A longest common subsequence algorithm suitable for similar text strings. Acta Informatica, 18:171-179, 1982. URL: https://doi.org/10.1007/BF00264437.
  25. Gonzalo Navarro. A guided tour to approximate string matching. ACM Computing Surveys, 33(1):31-88, 2001. URL: https://doi.org/10.1145/375360.375365.
  26. Alexandre H. L. Porto and Valmir Carneiro Barbosa. Finding approximate palindromes in strings. Pattern Recognition, 35(11):2581-2591, 2002. URL: https://doi.org/10.1016/S0031-3203(01)00179-0.
  27. David Sankoff. Matching sequences under deletion/insertion constraints. Proceedings of the National Academy of Sciences of the United States of America, 69(1):4-6, 1972. URL: http://www.jstor.org/stable/60967.
  28. Robert A. Wagner and Michael J. Fischer. The string-to-string correction problem. Journal of the ACM, 21(1):168-173, 1974. URL: https://doi.org/10.1145/321796.321811.
  29. Woburn Collegiate Institute Programming Enrichment Group (PEG) Wiki. Longest palindromic subsequence. http://wcipeg.com/wiki/Longest_palindromic_subsequence?#LCS-based_approach. Accessed: 2024.04.20.
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