The Longest Common Subsequence Problem A Finite Automata Approach

  • Bořivoj Melichar
  • Tomáš Polcar
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2759)


A new algorithm that creates a common subsequence automaton for a set of strings is presented. Moreover, it is shown that a longest common subsequence of two strings over a constant alphabet can be found in \( \mathcal{O}\left( {\left| A \right|\left( {\left| {S_1 } \right| + \left| {S_2 } \right| + \sum _{\alpha \in A} \left| {S_1 } \right|_\alpha \left| {S_2 } \right|_\alpha } \right)} \right) \) time, where |A| is the size of the alphabet, |S i | is the length of the input string i, and |S i |a is the number of occurrences of a ∈ A in S i .


Czech Republic Time Complexity Space Complexity Input String Longe Common Subsequence 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    Hirschberg, D. S.: A linear space algorithm for computing maximal common subsequences. Commun. ACM 18 (1975) 341–343zbMATHCrossRefMathSciNetGoogle Scholar
  2. [2]
    Hunt, J.W., Szymanski, T.G.: A fast algorithm for computing longest common subsequences. Commun. ACM 20 (1977) 350–353zbMATHCrossRefMathSciNetGoogle Scholar
  3. [3]
    Hébrard, J. J., Crochemore, M.: Calcul de la distance par les sous-mots. RAIRO Inform. Théor. Appl. 20 (1986) 441–456MathSciNetzbMATHGoogle Scholar
  4. [4]
    Troníček, Z., Melichar, B.: Directed acyclic subsequence graph. In Holub, J., Šimánek, M., eds.: Proceedings of the Prague Stringology Club Workshop’ 98, Czech Technical University, Praque, Czech Republic (1998) 107–118 Collaborative Report DC-98-06.Google Scholar
  5. [5]
    Crochemore, M., Troníček, Z.: Directed acyclic subsequnce graph for multiple texts. Repport I.G.M. 99-13, Université de Marne-la-Vallée (1999)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2003

Authors and Affiliations

  • Bořivoj Melichar
    • 1
  • Tomáš Polcar
    • 1
  1. 1.Department of Computer Science and Engineering Faculty of Electrical EngineeringCzech Technical UniversityPrague 2Czech Republic

Personalised recommendations