Abstract
The Longest Common Subsequence (LCS) problem is a classic and well-studied problem in computer science. The LCS problem is a common task in DNA sequence analysis with many applications to genetics and molecular biology. In this paper, we present a new and efficient algorithm for solving the LCS problem for two strings. Our algorithm runs in O(ℛlog log n+n) time, where ℛ is the total number of ordered pairs of positions at which the two strings match.
Similar content being viewed by others
References
Arlazarov, V.L., Dinic, E.A., Kronrod, M.A., Faradzev, I.A.: On economic construction of the transitive closure of a directed graph (English translation). Sov. Math. Dokl. 11, 1209–1210 (1975)
Arslan, A.N., Egecioglu, Ö: Algorithms for the constrained longest common subsequence problems. In: Stringology, pp. 24–32 (2004)
Arslan, A.N., Egecioglu, Ö: Algorithms for the constrained longest common subsequence problems. Int. J. Found. Comput. Sci. 16(6), 1099–1109 (2005)
Bender, M.A., Farach-Colton, M.: The lca problem revisited. In: LATIN, pp. 88–94 (2000)
Bergroth, L., Hakonen, H., Raita, T.: A survey of longest common subsequence algorithms. In: SPIRE, pp. 39–48 (2000)
Stølting Brodal, G., Kaligosi, K., Katriel, I., Kutz, M.: Faster algorithms for computing longest common increasing subsequences, pp. 330–341 (2006)
Crochemore, M., Landau, G.M., Ziv-Ukelson, M.: A sub-quadratic sequence alignment algorithm for unrestricted cost matrices. In: Symposium of Discrete Algorithms (SODA), pp. 679–688 (2002)
Gabow, H., Bentley, J., Tarjan, R.: Scaling and related techniques for geometry problems. In: STOC, pp. 135–143 (1984)
Hadlock, F.: Minimum detour methods for string or sequence comparison. Congr. Numer. 61, 263–274 (1988)
Hirschberg, D.S.: Algorithms for the longest common subsequence problem. J. ACM 24(4), 664–675 (1977)
Hunt, J.W., Szymanski, T.G.: A fast algorithm for computing longest subsequences. Commun. ACM 20(5), 350–353 (1977)
Iliopoulos, C.S., Rahman, M.S.: New efficient algorithms for the lcs and constrained lcs problems. Inf. Process. Lett. (to appear). doi: 10.1016/j.ipl.2007.09.008
Iliopoulos, C.S., Rahman, M.S.: Algorithms for computing variants of the longest common subsequence problem. Theor. Comput. Sci. (2007, to appear at a special issue)
Iliopoulos, C.S., Rahman, M.S.: New efficient algorithms for LCS and constrained LCS problem. In: Broersma, H., Dantchev, S.S., Johnson, M., Szeider, S. (eds.) ACiD, Texts in Algorithmics, vol. 9, pp. 83–94. King’s College, London (2007)
Jiang, T., Li, M.: On the approximation of shortest common supersequences and longest common subsequences. SIAM J. Comput. 24(5), 1122–1139 (1995)
Levenshtein, V.I.: Binary codes capable of correcting deletions, insertions, and reversals. Probl. Inf. Transm. 1, 8–17 (1965)
Ma, B., Zhang, K.: On the longest common rigid subsequence problem. In: CPM, pp. 11–20 (2005)
Maier, D.: The complexity of some problems on subsequences and supersequences. J. ACM 25(2), 322–336 (1978)
Masek, W.J., Paterson, M.: A faster algorithm computing string edit distances. J. Comput. Syst. Sci. 20(1), 18–31 (1980)
Mäkinen, V., Navarro, G., Ukkonen, E.: Transposition invariant string matching. J. Algorithms 56, 124–153 (2005)
Myers, E.W.: An o(nd) difference algorithm and its variations. Algorithmica 1(2), 251–266 (1986)
Nakatsu, N., Kambayashi, Y., Yajima, S.: A longest common subsequence algorithm suitable for similar text strings. Acta Inf. 18, 171–179 (1982)
Rahman, M.S., Iliopoulos, C.S.: Algorithms for computing variants of the longest common subsequence problem. In: Asano, T. (ed.) ISAAC. Lecture Notes in Computer Science, vol. 4288, pp. 399–408. Springer, Berlin (2006)
Rahman, M.S., Iliopoulos, C.S.: A new efficient algorithm for computing the longest common subsequence. In: Kao, M.-Y., Li, X.-Y. (eds.) AAIM. Lecture Notes in Computer Science, vol. 4508, pp. 82–90. Springer, Berlin (2007)
Tsai, Y.-T.: The constrained longest common subsequence problem. Inf. Process. Lett. 88(4), 173–176 (2003)
van Emde Boas, P.: Preserving order in a forest in less than logarithmic time and linear space. Inf. Process. Lett. 6, 80–82 (1977)
Wagner, R.A., Fischer, M.J.: The string-to-string correction problem. J. ACM 21(1), 168–173 (1974)
Author information
Authors and Affiliations
Corresponding author
Additional information
Preliminary version appeared in [24].
C.S. Iliopoulos is supported by EPSRC and Royal Society grants.
M.S. Rahman is supported by the Commonwealth Scholarship Commission in the UK under the Commonwealth Scholarship and Fellowship Plan (CSFP) and is on Leave from Department of CSE, BUET, Dhaka-1000, Bangladesh.
Rights and permissions
About this article
Cite this article
Iliopoulos, C.S., Rahman, M.S. A New Efficient Algorithm for Computing the Longest Common Subsequence. Theory Comput Syst 45, 355–371 (2009). https://doi.org/10.1007/s00224-008-9101-6
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00224-008-9101-6