Algorithms and Hardness for the Longest Common Subsequence of Three Strings and Related Problems

被引:0
|
作者
Wang, Lusheng [1 ,2 ]
Zhu, Binhai [3 ]
机构
[1] City Univ Hong Kong, Dept Comp Sci, Kowloon, Hong Kong, Peoples R China
[2] City Univ Hong Kong, ShenZhen Res Inst, Shenzhen, Peoples R China
[3] Montana State Univ, Gianforte Sch Comp, Bozeman, MT 59717 USA
基金
美国国家科学基金会;
关键词
Longest common subsequence; Longest cubic subsequence; NP-completeness; Polynomial-time algorithms; EFFICIENT ALGORITHM;
D O I
10.1007/978-3-031-43980-3_30
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
A string is called a square (resp. cube) if it is in the form of XX = X-2 (resp. XXX = X-3). Given a sequence S of length n, a fundamental problem studied in the literature is the problem of computing a longest subsequence of S which is a square or cube (i.e., the longest square/cubic subsequence problem). While the longest square subsequence (LSS) can be computed in O(n(2)) time, the longest cubic subsequence (LCubS) is only known to be solvable in O(n(5)) time, using the longest common subsequence of three strings (LCS-3) as a subroutine (which was much less studied compared with LCS for two strings, or LCS-2). To improve the running time for LCubS, we look at its complementary version and also investigate LCS-3 for three strings S-1, S-2, S-3, with input lengths m <= n(1) <= n(2) respectively. Firstly, we generalize an algorithm by Nakatsu et al. for LCS-2 to have an O(n(1)n(2)delta) algorithm for computing LCS-3, where delta is the minimum number of letters to be deleted in S-1 to have an LCS-3 solution for S-1, S-2 and S-3. This results in an O(k(3)n(2)) algorithm for LCubS, where k is the minimum number of letters deleted in S to have a feasible solution. Then, let R be the number of triples (i, j, k) that match in the input, i.e., S-1[i] = S-2[j] = S-3[k], we show that LCS-3 can be computed in O(n+ R log log n + R-2) time (n is the maximum length of the three input strings). Finally, we define the t-pseudo-subsequence of S under an integer parameter t, which is a string Z containing a subsequence S ' of S such that S ' can be obtained from Z by deleting at most t letters. Subsequently, we study the longest majority t-pseudo-subsequence (LMtPS) of S-i, i = 1..3, which is a t-pseudo-subsequence T = t(1)t(2) center dot center dot center dot t(K) of S-i, i = 1..3, with the maximum length K; moreover, when T is aligned with some subsequence S-i ''s of length K in S-i, i = 1..3, each t(j) matches at least two letters with S-i ', i = 1..3. We show that LMtPS of three strings S-1, S-2 and S-3 is polynomially solvable, while if we require additionally that all letters in Sigma appear in the solution T then it becomes NP-complete, via a reduction to a new SAT instance called Even-(3,B2)-SAT.
引用
收藏
页码:367 / 380
页数:14
相关论文
共 50 条
  • [31] New refinement techniques for longest common subsequence algorithms
    Bergroth, L
    Hakonen, H
    Väisänen, J
    STRING PROCESSING AND INFORMATION RETRIEVAL, PROCEEDINGS, 2003, 2857 : 287 - 303
  • [32] Efficient algorithms for finding a longest common increasing subsequence
    Chan, Wun-Tat
    Zhang, Yong
    Fung, Stanley P. Y.
    Ye, Deshi
    Zhu, Hong
    JOURNAL OF COMBINATORIAL OPTIMIZATION, 2007, 13 (03) : 277 - 288
  • [33] Anytime algorithms for the longest common palindromic subsequence problem
    Djukanovic, Marko
    Raidl, Guenther R.
    Blum, Christian
    COMPUTERS & OPERATIONS RESEARCH, 2020, 114
  • [34] Longest Common Subsequence Problem for Run-Length-Encoded Strings
    Ahsan, Shegufta Bakht
    Aziz, Syeda Persia
    Rahmana, M. Sohel
    JOURNAL OF COMPUTERS, 2014, 9 (08) : 1769 - 1775
  • [35] Longest Common Subsequence Problem for Run-Length-Encoded Strings
    Ahsan, Shegufta Bakht
    Aziz, Syeda Persia
    Rahman, M. Sohel
    2012 15TH INTERNATIONAL CONFERENCE ON COMPUTER AND INFORMATION TECHNOLOGY (ICCIT), 2012, : 36 - 41
  • [36] An Iterative Approach to Determining the Length of the Longest Common Subsequence of Two Strings
    Hilary S. Booth
    Shevarl F. MacNamara
    Ole M. Nielsen
    Susan R. Wilson
    Methodology And Computing In Applied Probability, 2004, 6 : 401 - 421
  • [37] An iterative approach to determining the length of the longest common subsequence of two strings
    Booth, HS
    MacNamara, SE
    Nielsen, OM
    Wilson, SR
    METHODOLOGY AND COMPUTING IN APPLIED PROBABILITY, 2004, 6 (04) : 401 - 421
  • [38] An approximation algorithm for multiple longest common subsequence problems
    Tsai, YT
    Hsu, JT
    6TH WORLD MULTICONFERENCE ON SYSTEMICS, CYBERNETICS AND INFORMATICS, VOL XII, PROCEEDINGS: INDUSTRIAL SYSTEMS AND ENGINEERING II, 2002, : 456 - 460
  • [39] A hardness result and new algorithm for the longest common palindromic subsequence problem
    Inenaga, Shunsuke
    Hyyro, Heikki
    INFORMATION PROCESSING LETTERS, 2018, 129 : 11 - 15
  • [40] Efficient Search Algorithms for the Restricted Longest Common Subsequence Problem
    Djukanovic, Marko
    Kartelj, Aleksandar
    Eftimov, Tome
    Reixach, Jaume
    Blum, Christian
    COMPUTATIONAL SCIENCE, ICCS 2024, PT V, 2024, 14836 : 58 - 73