We present a radically new indexing approach for approximate string matching.
The scheme uses the metric properties of the edit distance and can be applied to
any other metric between strings. We build a metric space where the sites are the
nodes of the suffix tree of the text, and the approximate query is seen as a proximity
query on that metric space. This permits us finding the occ occurrences of a pattern
of length m, permitting up to r differences, in a text of length n over an alphabet
of size σ, in average time O(m1+ǫ + occ) for any ǫ > 0, if r = o(m/ logσ m) and
m > 1+ǫ
ǫ logσ n. The index works well up to r < (3−√2)m/ logσ m, where it achieves
its maximum average search complexity O(m1+√2+ǫ + occ). The construction time
of the index is O(m1+√2+ǫn log n) and its space is O(m1+√2+ǫn). This is the first
index achieving average search time polynomial in m and independent of n, for r =
O(m/ logσ m). Previous methods achieve this complexity only for r = O(m/ logσ n).
We also present a simpler scheme needing O(n) space.