Constrained LCS: Hardness and Approximation

  • Authors:
  • Zvi Gotthilf;Danny Hermelin;Moshe Lewenstein

  • Affiliations:
  • Department of Computer Science, Bar-Ilan University, Ramat Gan, Israel 52900;Department of Computer Science, University of Haifa, Mount Carmel, Haifa, Israel 31905;Department of Computer Science, Bar-Ilan University, Ramat Gan, Israel 52900

  • Venue:
  • CPM '08 Proceedings of the 19th annual symposium on Combinatorial Pattern Matching
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

The problem of finding the longest common subsequence (LCS) of two given strings A1and A2is a well-studied problem. The constrained longest common subsequence (C-LCS) for three strings A1, A2and B1is the longest common subsequence of A1and A2that contains B1as a subsequence. The fastest algorithm solving the C-LCS problem has a time complexity of O(m1m2n1) where m1, m2and n1are the lengths of A1, A2and B1respectively. In this paper we consider two general variants of the C-LCS problem. First we show that in case of two input strings and an arbitrary number of constraint strings, it is NP-hard to approximate the C-LCS problem. Moreover, it is easy to see that in case of an arbitrary number of input strings and a single constraint, the problem of finding the constrained longest common subsequence is NP-hard. Therefore, we propose a linear time approximation algorithm for this variant, our algorithm yields a $1 / \sqrt{m_{min}|\Sigma|}$ approximation factor, where mminis the length of the shortest input string and |Σ| is the size of the alphabet.