New Efficient Algorithms for LCS and Constrained LCS Problem

Costas S. Iliopoulos, M. Sohel Rahman · 2007

Abstract. In this paper, we study the classic and well-studied longest common subsequence (LCS) problem and a recent variant of it namely constrained LCS (CLCS) problem. In CLCS, the computed LCS must also be a supersequence of a third given string. In this paper, we first present an efficient algorithm for the traditional LCS problem that runs in O(R log log n + n) time, where R is the total number of ordered pairs of positions at which the two strings match and n is the length of the two given strings. Then, using this algorithm, we devise an algorithm for the CLCS problem having time complexity O(pR log log n + n) in the worst case, where p is the length of the third string. Note that, if R = o(n 2), our algorithm will perform very well but, if R = O(n 2), then, due to the log log n term, our algorithms will behave slightly worse than the existing algorithms. 1

Read the paper · More papers on PaperTik