Abstract
This paper introduces the first constant-factor approximation algorithm for Edit Distance (ED) in the asymmetric streaming model that utilizes sub-polynomial memory ($O(n^\delta)$). By leveraging the triangle inequality and a recursive decomposition strategy, the authors demonstrate how to trade exponential runtime for significant memory savings. This approach provides a new framework for comparing massive strings, such as genomic sequences, in memory-constrained environments.
Introduction
Measuring similarity between strings is fundamental to computer science, primarily through Edit Distance (ED)—the minimum edits required to transform one string into another—and Longest Common Subsequence (LCS). However, as data scales to billions of base pairs, classic $O(n^2)$ time and $O(n)$ space algorithms become impractical.
The authors address this by focusing on the asymmetric streaming model. In this setting, one string (the "offline" string) is stored with random access, while the second (the "online" string) arrives as a single-pass stream. The goal is to approximate similarity using minimal working memory. Prior to this work, efficient streaming algorithms were generally limited to cases where the distance between strings was already very small.
Methodology: The Triangle Inequality and Recursive Decomposition
The core innovation is a strategy that uses the triangle inequality to reduce space complexity. Instead of calculating distances between the stream and every possible offline substring, the algorithm employs a "Closest Substring" strategy.
- Windowing: The incoming stream is partitioned into windows.
- Mapping: For each window, the algorithm identifies the most similar substring in the offline string.
- Compression: Rather than storing the window data, the algorithm stores only the coordinates and the distance to the "best" substring.
- Triangle Inequality: By knowing the distance from a window $w$ to substring $A$, and calculating the distance between $A$ and another substring $B$ via random access, the algorithm approximates the distance from $w$ to $B$ without needing $w$ in memory.
To achieve sub-polynomial memory ($O(n^\delta)$), this logic is applied recursively across multiple levels, breaking the problem into increasingly smaller fragments. This reduction significantly lowers memory usage but causes the approximation error to grow and the runtime to increase exponentially relative to $1/\delta$.
Key Results and Theoretical Bounds
The paper establishes several new upper bounds for memory usage in the asymmetric streaming model. Notably, all proposed algorithms are deterministic, avoiding the failure probabilities associated with stochastic sketching or hashing methods.
The results for LCS are particularly significant as they match known lower bounds, proving the optimality of the $\tilde{O}(\sqrt{n})$ memory requirement for a $(1-\epsilon)$-approximation. Additionally, the framework generalizes to improve bounds for related problems such as Distance to Monotonicity (DTM) and Longest Increasing Subsequence (LIS).
Discussion and Limitations
While the memory savings are substantial, they come with a "Savitch-like" trade-off: the constant-factor approximation for ED requires runtime that is exponential in $1/\delta$. This may limit practical application for extremely small $\delta$ values where processing time becomes prohibitive.
Furthermore, the model's reliance on random access to one string means it does not directly translate to "double-stream" scenarios where both strings are online. Finally, while LCS bounds are tight, a theoretical gap remains for $(1+\epsilon)$-ED approximations, presenting a clear path for future research in closing the gap between $O(\sqrt{n})$ memory and known lower bounds.
Summary updated