Maximal common subsequences and minimal common supersequences

  • Robert W. Irving
  • Campbell B. Fraser
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 807)


The problems of finding a longest common subsequence and a shortest common supersequence of a set of strings are well-known. They can be solved in polynomial time for two strings (in fact the problems are dual in this case), or for any fixed number of strings, by dynamic programming. But both problems are NP-hard in general for an arbitrary number k of strings. Here we study the related problems of finding a minimum-length maximal common subsequence and a maximum-length minimal common supersequence. We describe dynamic programming algorithms for the case of two strings (for which case the problems are no longer dual), which can be extended to any fixed number of strings. We also show that the minimum maximal common subsequence problem is NP-hard in general for k strings, and we prove a strong negative approximability result for this problem. The complexity of the maximum minimal common supersequence problem for general k remains open, though we conjecture that it too is NP-hard.

Key words

string algorithms subsequence supersequence dynamic programming NP-hard optimisation problems approximation algorithms 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    A. Apostolico and C. Guerra. The longest common subsequence problem revisited. Algorithmica, 2:315–336, 1987.Google Scholar
  2. 2.
    S. Arora, C. Lund, R. Motwani, M. Sudan, and M. Szegedy. Proof verification and hardness of approximation problems. In Proc. 33rd IEEE Symp. Found. Comp. Sci., pages 14–23, 1992.Google Scholar
  3. 3.
    M.R. Garey and D.S. Johnson. Computers and Intractability. Freeman, San Francisco, CA., 1979.Google Scholar
  4. 4.
    M.M. Halldórsson. Approximating the minimum maximal independence number. Information Processing Letters, 46:169–172, 1993.Google Scholar
  5. 5.
    D.S. Hirschberg. A linear space algorithm for computing maximal common subsequences. Communications of the A.C.M., 18:341–343, 1975.Google Scholar
  6. 6.
    D.S. Hirschberg. Algorithms for the longest common subsequence problem. Journal of the A.C.M., 24:664–675, 1977.Google Scholar
  7. 7.
    J.W. Hunt and T.G. Szymanski. A fast algorithm for computing longest common subsequences. Communications of the A.C.M., 20:350–353, 1977.Google Scholar
  8. 8.
    R.W. Irving. On approximating the minimum independent dominating set. Information Processing Letters, 37:197–200, 1991.Google Scholar
  9. 9.
    T. Jiang and M. Li. On the approximation of shortest common supersequences and longest common subsequences. Submitted for publication, 1992.Google Scholar
  10. 10.
    D. Maier. The complexity of some problems on subsequences and supersequences. Journal of the A.C.M., 25:322–336, 1978.Google Scholar
  11. 11.
    C.H. Papadimitriou and M. Yannakakis. Optimization, approximation, and complexity classes. Journal of Computer and System Sciences, 43:425–440, 1991.Google Scholar
  12. 12.
    K-J. Raiha and E. Ukkonen. The shortest common supersequence problem over binary alphabet is NP-complete. Theoretical Computer Science, 16:187–198, 1981.Google Scholar
  13. 13.
    V.G. Timkovskii. Complexity of common subsequence and supersequence problems and related problems. English Translation from Kibernetika, 5:1–13, 1989.Google Scholar
  14. 14.
    E. Ukkonen. Algorithms for approximate string matching. Information and Control, 64:100–118, 1985.Google Scholar
  15. 15.
    S. Wu, U. Manber, G. Myers, and W. Miller. An O(NP) sequence comparison algorithm. Information Processing Letters, 35:317–323, 1990.Google Scholar
  16. 16.
    M. Yannakakis and F. Gavril. Edge dominating sets in graphs. SIAM J. Appl. Math., 38:364–372, 1980.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1994

Authors and Affiliations

  • Robert W. Irving
    • 1
  • Campbell B. Fraser
    • 1
  1. 1.Computing Science DepartmentUniversity of GlasgowGlasgowScotland

Personalised recommendations