string - Given the pairwise edit distance of a and b and b and c, can we find the pairwise edit distance of a and c? -
if have 3 string a, b, c , know ( or calculated ) edit_distance(a,b) , edit_distance(b,c), can efficiently calculate edit_distance(a,c) without comparing , c.
*edit_distance(a,b) = number of character insertion, deletion , replacement required convert b.*
in general, no. example, take
- a = cap
- b = cat
- c = car
here, edit_distance(a, b) = 1 , edit_distance(b, c) = 1. moreover, edit_distance(a, c) = 1.
however, have
- a = cap
- b = cat
- c = rat
here, edit_distance(a, b) = 1 , edit_distance(b, c) = 1, edit_distance(a, c) = 2. therefore, there no way purely use edit distances of , b , of b , c compute edit distance of , c.
however, do know edit_distance(a, c) ≤ edit_distance(a, b) + edit_distance(b, c), since can apply transformations in sequence turn c. more generally, edit distance forms discrete distance metric, forms basis of bk-tree data structure.
hope helps!
Comments
Post a Comment