The edit distance between strings a~ ... a m and bl "'" b, is the minimum cost s of a sequence of editing steps (insertions, deletions, changes) that convert one string into the other. A well-known tabulating method computes s as well as the corresponding editing sequence in time and in space O(mn) (in space O(min(m, n)) if the editing sequence is not required). Starting from this method, we develop an improved algorithm that works in time and in space O(s. min(m, n)). Another improvement with time O(s.min(m, n)) and space O (s-min(s, m, n)) is given for the special case where all editing steps have the same cost independently of the characters involved. If the editing sequence that gives cost s is not required, our algorithms can be implemented in space O(min(s, m, n)). Since s= O(max(m, n)), the new methods are always asymptotically as good as the original tabulating method. As a byproduct, algorithms are obtained that, given a threshold value t, test in time O (t'min(m,n)) and in space O(min(t,m,n)) whether s<<.t. Finally, different generalized edit distances are analyzed and conditions are given under which our algorithms can be used in conjunction with extended edit operation sets, including, for example, transposition of adjacent characters.
It is well-known that the edit distance veri cation problem under distance threshold K can be solved in time O(N K) by dynamic programming REF .
Algorithms for Approximate String Matching
Information and Control
Information and Control
Computer Science Mathematics