Skip to main content

Advertisement

Log in

A New Efficient Algorithm for Computing the Longest Common Subsequence

  • Published:
Theory of Computing Systems Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. 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)

    Google Scholar 

  2. Arslan, A.N., Egecioglu, Ö: Algorithms for the constrained longest common subsequence problems. In: Stringology, pp. 24–32 (2004)

  3. Arslan, A.N., Egecioglu, Ö: Algorithms for the constrained longest common subsequence problems. Int. J. Found. Comput. Sci. 16(6), 1099–1109 (2005)

    Article  MATH  MathSciNet  Google Scholar 

  4. Bender, M.A., Farach-Colton, M.: The lca problem revisited. In: LATIN, pp. 88–94 (2000)

  5. Bergroth, L., Hakonen, H., Raita, T.: A survey of longest common subsequence algorithms. In: SPIRE, pp. 39–48 (2000)

  6. Stølting Brodal, G., Kaligosi, K., Katriel, I., Kutz, M.: Faster algorithms for computing longest common increasing subsequences, pp. 330–341 (2006)

  7. 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)

  8. Gabow, H., Bentley, J., Tarjan, R.: Scaling and related techniques for geometry problems. In: STOC, pp. 135–143 (1984)

  9. Hadlock, F.: Minimum detour methods for string or sequence comparison. Congr. Numer. 61, 263–274 (1988)

    MathSciNet  Google Scholar 

  10. Hirschberg, D.S.: Algorithms for the longest common subsequence problem. J. ACM 24(4), 664–675 (1977)

    Article  MATH  MathSciNet  Google Scholar 

  11. Hunt, J.W., Szymanski, T.G.: A fast algorithm for computing longest subsequences. Commun. ACM 20(5), 350–353 (1977)

    Article  MATH  MathSciNet  Google Scholar 

  12. 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

  13. 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)

  14. 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)

    Google Scholar 

  15. Jiang, T., Li, M.: On the approximation of shortest common supersequences and longest common subsequences. SIAM J. Comput. 24(5), 1122–1139 (1995)

    Article  MATH  MathSciNet  Google Scholar 

  16. Levenshtein, V.I.: Binary codes capable of correcting deletions, insertions, and reversals. Probl. Inf. Transm. 1, 8–17 (1965)

    Google Scholar 

  17. Ma, B., Zhang, K.: On the longest common rigid subsequence problem. In: CPM, pp. 11–20 (2005)

  18. Maier, D.: The complexity of some problems on subsequences and supersequences. J. ACM 25(2), 322–336 (1978)

    Article  MATH  MathSciNet  Google Scholar 

  19. Masek, W.J., Paterson, M.: A faster algorithm computing string edit distances. J. Comput. Syst. Sci. 20(1), 18–31 (1980)

    Article  MATH  MathSciNet  Google Scholar 

  20. Mäkinen, V., Navarro, G., Ukkonen, E.: Transposition invariant string matching. J. Algorithms 56, 124–153 (2005)

    Article  MATH  MathSciNet  Google Scholar 

  21. Myers, E.W.: An o(nd) difference algorithm and its variations. Algorithmica 1(2), 251–266 (1986)

    Article  MATH  MathSciNet  Google Scholar 

  22. Nakatsu, N., Kambayashi, Y., Yajima, S.: A longest common subsequence algorithm suitable for similar text strings. Acta Inf. 18, 171–179 (1982)

    MATH  MathSciNet  Google Scholar 

  23. 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)

    Google Scholar 

  24. 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)

    Google Scholar 

  25. Tsai, Y.-T.: The constrained longest common subsequence problem. Inf. Process. Lett. 88(4), 173–176 (2003)

    Article  Google Scholar 

  26. van Emde Boas, P.: Preserving order in a forest in less than logarithmic time and linear space. Inf. Process. Lett. 6, 80–82 (1977)

    Article  MATH  Google Scholar 

  27. Wagner, R.A., Fischer, M.J.: The string-to-string correction problem. J. ACM 21(1), 168–173 (1974)

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to M. Sohel Rahman.

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

Reprints 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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00224-008-9101-6

Keywords

Navigation