AbstractThe longest common subsequence (LCS) problem is one of the classical and well-studied problems in computer science. The computation of the LCS is a frequent task in DNA sequence analysis, and has applications to genetics and molecular biology. In this paper we introduce new variants of LCS problem and present efficient algorithms to solve them. In particular we introduce the notion of gap constraints in the LCS problems. For the LCS problem with fixed gap, we first present a naive algorithm runs in O(n2+R(K+1)2) time, where R is the total number of ordered pairs of positions at which the two strings match and K is the fixed gap constraint. We then improve the running time to O(n2+RK+Rloglogn) using some novel techniques. Furthermore...