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 条
  • [41] Dynamic programming algorithms for the mosaic longest common subsequence problem
    Huang, Kuo-Si
    Yang, Chang-Biau
    Tseng, Kuo-Tsung
    Peng, Yung-Hsing
    Ann, Hsing-Yen
    INFORMATION PROCESSING LETTERS, 2007, 102 (2-3) : 99 - 103
  • [42] Efficient merged longest common subsequence algorithms for similar sequences
    Tseng, Kuo-Tsung
    Chan, De-Sheng
    Yang, Chang-Biau
    Lo, Shou-Fu
    THEORETICAL COMPUTER SCIENCE, 2018, 708 : 75 - 90
  • [43] Computing the Longest Common Subsequence of Two Run-Length Encoded Strings
    Sakai, Yoshifumi
    ALGORITHMS AND COMPUTATION, ISAAC 2012, 2012, 7676 : 197 - 206
  • [44] THE LONGEST COMMON SUBSEQUENCE PROBLEM FOR SMALL ALPHABET SIZE BETWEEN MANY STRINGS
    HAKATA, K
    IMAI, H
    LECTURE NOTES IN COMPUTER SCIENCE, 1992, 650 : 469 - 478
  • [45] A Fast Heuristic Search Algorithm for Finding the Longest Common Subsequence of Multiple Strings
    Wang, Qingguo
    Pan, Mian
    Shang, Yi
    Korkin, Dmitry
    PROCEEDINGS OF THE TWENTY-FOURTH AAAI CONFERENCE ON ARTIFICIAL INTELLIGENCE (AAAI-10), 2010, : 1287 - 1292
  • [46] Cyclic longest common subsequence
    Naiman, Aaron E.
    Farber, Eliav
    Stein, Yossi
    DISCRETE MATHEMATICS ALGORITHMS AND APPLICATIONS, 2023, 15 (04)
  • [47] The longest letter-duplicated subsequence and related problems
    Lai, Wenfeng
    Liyanage, Adiesha
    Zhu, Binhai
    Zou, Peng
    ACTA INFORMATICA, 2024, 61 (03) : 315 - 329
  • [48] Exemplar longest common subsequence
    Bonizzoni, Paola
    Della Vedova, Gianluca
    Dondi, Riccardo
    Fertin, Guillaume
    Rizzi, Raffaella
    Vialette, Stephane
    IEEE-ACM TRANSACTIONS ON COMPUTATIONAL BIOLOGY AND BIOINFORMATICS, 2007, 4 (04) : 535 - 543
  • [49] On the longest common parameterized subsequence
    Keller, Orgad
    Kopelowitz, Tsvi
    Lewenstein, Moshe
    THEORETICAL COMPUTER SCIENCE, 2009, 410 (51) : 5347 - 5353
  • [50] On the longest common parameterized subsequence
    Keller, Orgad
    Kopelowitz, Tsvi
    Lewenstein, Moshe
    COMBINATORIAL PATTERN MATCHING, 2008, 5029 : 303 - +