Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article
Free access

A fast algorithm for computing longest common subsequences

Published: 01 May 1977 Publication History

Abstract

Previously published algorithms for finding the longest common subsequence of two sequences of length n have had a best-case running time of O(n2). An algorithm for this problem is presented which has a running time of O((r + n) log n), where r is the total number of ordered pairs of positions at which the two sequences match. Thus in the worst case the algorithm has a running time of O(n2 log n). However, for those applications where most positions of one sequence match relatively few positions in the other sequence, a running time of O(n log n) can be expected.

References

[1]
Chvatal, V., Klarner, D.A., and Knuth, D.E. Selected combinatorial research problems. STAN-CS-72-292, Dep. Comptr. Sci., Stanford U., Stanford, Calif., June 1972.
[2]
van Emde Boas, P. Preserving order in a forest in less than logarithmic time. 16th Annual Symp. on Foundations Comptr. Sci., Oct. 1975, pp. 75-84.
[3]
Fredman, M.L. On computing the length of longest increasing subsequences. Discrete Mathematics 11, 1 (Jan. 1975), 29-35.
[4]
Hirschberg, D.S. A linear space algorithm for computing maximal common subsequences. Comm. ACM 18, 6 (June 1975), 341-343.
[5]
Szymansld, T.G. A special case of the maximal common subsequence problem. TR-170, Dep. Electrical Eng., Princeton U., Princeton, N.J., Jan. 1975.
[6]
Wagner, R.A. and Fischer, M.J. The string-to-string correction problem. J. ACM 21, 1 (Jan. 1975), 168-173.
[7]
Yao, A.C. and Yao, F.F. On computing the rank function for a set of vectors. UIUCDCS-R-75-699, Dep. Comptr. Sci., U. of Illinois at Urbana-Champaign, Urbana, Ill., Feb. 1975.

Cited By

View all
  • (2024)ESGen: Commit Message Generation Based on Edit Sequence of Code ChangeProceedings of the 32nd IEEE/ACM International Conference on Program Comprehension10.1145/3643916.3644414(112-124)Online publication date: 15-Apr-2024
  • (2024)An Optimal MPC Algorithm for Subunit-Monge Matrix Multiplication, with Applications to LISProceedings of the 36th ACM Symposium on Parallelism in Algorithms and Architectures10.1145/3626183.3659974(145-154)Online publication date: 17-Jun-2024
  • (2024)Parallel and (Nearly) Work-Efficient Dynamic ProgrammingProceedings of the 36th ACM Symposium on Parallelism in Algorithms and Architectures10.1145/3626183.3659958(219-232)Online publication date: 17-Jun-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Communications of the ACM
Communications of the ACM  Volume 20, Issue 5
May 1977
69 pages
ISSN:0001-0782
EISSN:1557-7317
DOI:10.1145/359581
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 May 1977
Published in CACM Volume 20, Issue 5

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. efficient algorithms
  2. longest common subsequence

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)464
  • Downloads (Last 6 weeks)57
Reflects downloads up to 04 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2024)ESGen: Commit Message Generation Based on Edit Sequence of Code ChangeProceedings of the 32nd IEEE/ACM International Conference on Program Comprehension10.1145/3643916.3644414(112-124)Online publication date: 15-Apr-2024
  • (2024)An Optimal MPC Algorithm for Subunit-Monge Matrix Multiplication, with Applications to LISProceedings of the 36th ACM Symposium on Parallelism in Algorithms and Architectures10.1145/3626183.3659974(145-154)Online publication date: 17-Jun-2024
  • (2024)Parallel and (Nearly) Work-Efficient Dynamic ProgrammingProceedings of the 36th ACM Symposium on Parallelism in Algorithms and Architectures10.1145/3626183.3659958(219-232)Online publication date: 17-Jun-2024
  • (2024)Pattern Mining-Based Warning Prioritization by Refining Abstract Syntax TreeInternational Journal of Software Engineering and Knowledge Engineering10.1142/S0218194024500293(1-27)Online publication date: 23-Jul-2024
  • (2024)Tracking the Evolution of Static Code Warnings: The State-of-the-Art and a Better ApproachIEEE Transactions on Software Engineering10.1109/TSE.2024.335828350:3(534-550)Online publication date: 1-Mar-2024
  • (2024)An Average-Case Efficient Two-Stage Algorithm for Enumerating All Longest Common Substrings of Minimum Length $k$ Between Genome Pairs2024 IEEE 12th International Conference on Healthcare Informatics (ICHI)10.1109/ICHI61247.2024.00020(93-102)Online publication date: 3-Jun-2024
  • (2024)Exact global alignment using A* with chaining seed heuristic and match pruningBioinformatics10.1093/bioinformatics/btae03240:3Online publication date: 23-Jan-2024
  • (2024)The longest almost increasing subsequence problem with sliding windowsTheoretical Computer Science10.1016/j.tcs.2024.1146391005(114639)Online publication date: Jul-2024
  • (2024)Dynamic-MLCSKnowledge-Based Systems10.1016/j.knosys.2024.111654293:COnline publication date: 7-Jun-2024
  • (2024)Computing Longest Lyndon Subsequences and Longest Common Lyndon SubsequencesAlgorithmica10.1007/s00453-023-01125-z86:3(735-756)Online publication date: 1-Mar-2024
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media