All Semi-local Longest Common Subsequences in Subquadratic Time

  • Alexander Tiskin
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3967)


For two strings a, b of lengths m, n respectively, the longest common subsequence (LCS) problem consists in comparing a and b by computing the length of their LCS . In this paper, we define a generalisation, called “the all semi-local LCS problem”, where each string is compared against all substrings of the other string, and all prefixes of each string are compared against all suffixes of the other string. An explicit representation of the output lengths is of size Θ ((m+n)2). We show that the output can be represented implicitly by a geometric data structure of size O(m+n), allowing efficient queries of the individual output lengths. The currently best all string-substring LCS algorithm by Alves et al. can be adapted to produce the output in this form. We also develop the first all semi-local LCS algorithm, running in time o(mn) when m and n are reasonably close. Compared to a number of previous results, our approach presents an improvement in algorithm functionality, output representation efficiency, and/or running time.


Score Matrix Longe Common Subsequence Longe Common Subsequence Score Matrice Output Length 
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.
    Alves, C.E.R., Cáceres, E.N., Song, S.W.: An all-substrings common subsequence algorithm. Electronic Notes in Discrete Mathematics 19, 133–139 (2005)MathSciNetCrossRefMATHGoogle Scholar
  2. 2.
    Arlazarov, V.L., Dinic, E.A., Kronrod, M.A., Faradzev, I.A.: On economical construction of the transitive closure of an oriented graph. Soviet Mathematical Doklady 11, 1209–1210 (1970)MATHGoogle Scholar
  3. 3.
    Bentley, J.L.: Multidimensional divide-and-conquer. Communications of the ACM 23(4), 214–229 (1980)MathSciNetCrossRefMATHGoogle Scholar
  4. 4.
    Burkard, R.E., Klinz, B., Rudolf, R.: Perspectives of Monge properties in optimization. Discrete Applied Mathematics 70, 95–161 (1996)MathSciNetCrossRefMATHGoogle Scholar
  5. 5.
    Crochemore, M., Landau, G.M., Ziv-Ukelson, M.: A subquadratic sequence alignment algorithm for unrestricted score matrices. SIAM Journal on Computing 32(6), 1654–1673 (2003)MathSciNetCrossRefMATHGoogle Scholar
  6. 6.
    Crochemore, M., Rytter, W.: Text Algorithms. Oxford University Press, Oxford (1994)MATHGoogle Scholar
  7. 7.
    Gusfield, D.: Algorithms on Strings, Trees, and Sequences: Computer Science and Computational Biology. Cambridge University Press, Cambridge (1997)CrossRefMATHGoogle Scholar
  8. 8.
    JaJa, J., Mortensen, C., Shi, Q.: Space-efficient and fast algorithms for multidimensional dominance reporting and counting. In: Fleischer, R., Trippen, G. (eds.) ISAAC 2004. LNCS, vol. 3341, pp. 558–568. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  9. 9.
    Jones, N.C., Pevzner, P.A.: An introduction to bioinformatics algorithms. In: Computational Molecular Biology. The MIT Press, Cambridge (2004)Google Scholar
  10. 10.
    Kim, S.-R., Park, K.: A dynamic edit distance table. Journal of Discrete Algorithms 2, 303–312 (2004)MathSciNetCrossRefMATHGoogle Scholar
  11. 11.
    Landau, G.M., Myers, E., Ziv-Ukelson, M.: Two algorithms for LCS consecutive suffix alignment. In: Sahinalp, S.C., Muthukrishnan, S.M., Dogrusoz, U. (eds.) CPM 2004. LNCS, vol. 3109, pp. 173–193. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  12. 12.
    Landau, G.M., Myers, E.W., Schmidt, J.P.: Incremental string comparison. SIAM Journal on Computing 27(2), 557–582 (1998)MathSciNetCrossRefMATHGoogle Scholar
  13. 13.
    Landau, G.M., Ziv-Ukelson, M.: On the common substring alignment problem. Journal of Algorithms 41, 338–359 (2001)MathSciNetCrossRefMATHGoogle Scholar
  14. 14.
    Masek, W.J., Paterson, M.S.: A faster algorithm computing string edit distances. Journal of Computer and System Sciences 20, 18–31 (1980)MathSciNetCrossRefMATHGoogle Scholar
  15. 15.
    Navarro, G.: A guided tour to approximate string matching. ACM Computing Surveys 33(1), 31–88 (2001)CrossRefGoogle Scholar
  16. 16.
    Preparata, F.P., Shamos, M.I.: Computational Geometry: An Introduction. In: Texts and Monographs in Computer Science, Springer, Heidelberg (1985)Google Scholar
  17. 17.
    Schmidt, J.P.: All highest scoring paths in weighted grid graphs and their application to finding all approximate repeats in strings. SIAM Journal on Computing 27(4), 972–992 (1998)MathSciNetCrossRefMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Alexander Tiskin
    • 1
  1. 1.Department of Computer ScienceThe University of WarwickCoventryUnited Kingdom

Personalised recommendations