Incremental string comparison

被引:113
作者
Landau, GM [1 ]
Myers, EW
Schmidt, JP
机构
[1] Univ Arizona, Dept Comp Sci, Tucson, AZ 85721 USA
[2] Polytech Univ, Dept Comp Sci, Brooklyn, NY 11201 USA
关键词
string matching; edit-distance; dynamic programming;
D O I
10.1137/S0097539794264810
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
The problem of comparing two sequences A and B to determine their longest common subsequence (LCS) or the edit distance between them has been much studied. In this paper we consider the following incremental version of these problems: given an appropriate encoding of a comparison between A and B, can one incrementally compute the answer for A and bB, and the answer for A and Bb with equal efficiency, where b is an additional symbol? Our main result is a theorem exposing a surprising relationship between the dynamic programming solutions for two such "adjacent" problems. Given a threshold k on the number of differences to be permitted in an alignment, the theorem leads directly to an O(k) algorithm for incrementally computing a new solution from an old one, as contrasts the O(k(2)) time required to compute a solution from scratch. We further show, with a series of applications, that this algorithm is indeed more powerful than its nonincremental counterpart. We show this by solving the applications with greater asymptotic efficiency than heretofore possible. For example, we obtain O(nk) algorithms for the longest prefix approximate match problem, the approximate overlap problem, and cyclic string comparison.
引用
收藏
页码:557 / 582
页数:26
相关论文
共 28 条