Skip to main content
QUICK REVIEW

[Paper Review] Streaming Algorithms For Computing Edit Distance Without Exploiting Suffix Trees

Diptarka Chakraborty, Elazar Goldenberg|arXiv (Cornell University)|Jul 13, 2016
Algorithms and Data CompressionComputer Science21 references9 citations
TL;DR

This paper presents two streaming algorithms for computing edit distance without relying on suffix trees, achieving near-optimal time complexity. The main contribution is an O(n + k³)-time, O(k)-space algorithm that processes strings in one pass, independent of alphabet size, making it practical and efficient for small edit distances k ≪ n.

ABSTRACT

The edit distance is a way of quantifying how similar two strings are to one another by counting the minimum number of character insertions, deletions, and substitutions required to transform one string into the other. In this paper we study the computational problem of computing the edit distance between a pair of strings where their distance is bounded by a parameter $k\ll n$. We present two streaming algorithms for computing edit distance: One runs in time $O(n+k^2)$ and the other $n+O(k^3)$. By writing $n+O(k^3)$ we want to emphasize that the number of operations per an input symbol is a small constant. In particular, the running time does not depend on the alphabet size, and the algorithm should be easy to implement. Previously a streaming algorithm with running time $O(n+k^4)$ was given in the paper by the current authors (STOC'16). The best off-line algorithm runs in time $O(n+k^2)$ (Landau et al., 1998) which is known to be optimal under the Strong Exponential Time Hypothesis.

Motivation & Objective

  • Address the need for efficient, streaming computation of edit distance in scenarios where the edit distance k is much smaller than string length n.
  • Overcome the high constant factors and alphabet-size dependence of suffix tree-based methods, especially for large alphabets.
  • Design a practical, one-pass streaming algorithm that avoids suffix trees while matching or improving on the best known offline time complexity.
  • Ensure the algorithm is simple to implement and has a constant number of operations per input symbol, independent of alphabet size.

Proposed method

  • Use a dynamic programming approach over the edit distance matrix, tracking diagonal slides of matching characters.
  • Introduce mature diagonals that are periodically checked for consistency and migrated to a mature list when they exceed 4k consecutive matches.
  • Maintain lists L_i for active diagonal slides and a matureList for diagonals with long, consistent matches, reducing computation on stable regions.
  • Leverage periodicity properties: if multiple diagonals are mature, their common period is computed via GCD of their differences, enabling efficient pattern detection.
  • Use arrays C(d,h) and D(d,h) to track the number of matches and pointers to active diagonal entries, respectively.
  • Apply a novel update mechanism that only processes diagonals that are either mature or in active sliding lists, minimizing redundant computation.

Experimental results

Research questions

  • RQ1Can edit distance be computed in streaming fashion with time complexity O(n + k³) and space O(k), independent of alphabet size?
  • RQ2Is it possible to avoid suffix trees while achieving near-optimal time complexity for small k?
  • RQ3How can periodicity in matching substrings be exploited to reduce the number of operations per input symbol?
  • RQ4Can a one-pass streaming algorithm be both theoretically efficient and practically simple to implement?
  • RQ5What is the impact of alphabet size on the performance of streaming edit distance algorithms, and can it be eliminated from the time complexity?

Key findings

  • The proposed algorithm runs in O(n + k³) time and uses O(k) space, with a constant number of operations per input symbol, independent of the alphabet size.
  • The algorithm avoids suffix trees entirely, eliminating their high constant factors and super-linear cost for large alphabets.
  • The method achieves a time complexity that matches the best offline algorithm (O(n + k²)) up to a k factor, under the Strong Exponential Time Hypothesis.
  • The use of mature diagonals and periodicity detection allows the algorithm to skip redundant checks, significantly reducing computation on long matching segments.
  • The algorithm is the first to achieve truly linear time for small k, making it practical for applications like DNA sequence comparison where k is small but n is large.
  • Empirical efficiency is enhanced by the fact that the algorithm processes each symbol in a small constant number of operations, with the O(k³) term arising only from handling active diagonal slides and mature list maintenance.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.