The problem of comparing two sequences A and B to determine their similarity is one of the fundamental problems in pattern matching. A challenging, basic variation of the sequence similarity problem is the incremental string comparison problem, denoted Consecutive Suffix Alignment, which is, given two strings A and B, to compute the alignment of each suffix of A versus B. Here, we present two solutions to the Consecutive Suffix Alignment Problem under the LCS metric. The first solution is an O(nL) time and space algorithm for constant alphabets, where n is the size of A, m is the size of B and L n denotes the size of the LCS of A and B. The second solution is an O(nL + n log ) time and O(L) space algorithm for general alphabets, where denotes the size of the alphabet of A and B. (Note that n).
Gad M. Landau, Eugene W. Myers, Michal Ziv-Ukelson