[Paper Review] Streaming Periodicity with Mismatches
This paper presents streaming algorithms for detecting all $k$-periods in a string $S$ with mismatches, using poly$(k, \log n)$ space. It introduces a one-pass algorithm for periods $\leq n/2$ and a two-pass algorithm for arbitrary period lengths, with matching lower bounds showing $\Omega(k\log n)$ space is necessary for one-pass computation when $k = o(\sqrt{n})$, resolving a key challenge in sublinear-space periodicity detection under mismatches.
We study the problem of finding all $k$-periods of a length-$n$ string $S$, presented as a data stream. $S$ is said to have $k$-period $p$ if its prefix of length $n-p$ differs from its suffix of length $n-p$ in at most $k$ locations. We give a one-pass streaming algorithm that computes the $k$-periods of a string $S$ using $ ext{poly}(k, \log n)$ bits of space, for $k$-periods of length at most $\frac{n}{2}$. We also present a two-pass streaming algorithm that computes $k$-periods of $S$ using $ ext{poly}(k, \log n)$ bits of space, regardless of period length. We complement these results with comparable lower bounds.
Motivation & Objective
- To design space-efficient streaming algorithms for identifying all $k$-periods in a string, where $k$-period means the prefix and suffix of length $n-p$ differ in at most $k$ positions.
- To address the challenge of periodicity detection in the presence of mismatches, which breaks classical periodicity properties like gcd-based period closure.
- To provide a one-pass algorithm for $k$-periods of length at most $n/2$, and a two-pass algorithm for all $k$-periods, both using $\mathcal{O}(k^4 \log^9 n)$ space.
- To establish tight space lower bounds, showing $\Omega(k\log n)$ space is necessary for one-pass $k$-period detection when $k = o(\sqrt{n})$, even under the promise that the $k$-period is at most $n/2$.
Proposed method
- Leverages fingerprinting data structures from pattern matching with mismatches to compress and compare substrings efficiently in streaming settings.
- Uses a two-pass approach to compute $k$-periods for any period length by first estimating candidate periods and then verifying them.
- Employs a one-pass algorithm that restricts attention to periods $\leq n/2$, using fingerprinting and sampling to detect periodicity with bounded mismatches.
- Applies a reduction to the Hamming distance problem to prove lower bounds, constructing strings where distinguishing $\mathsf{HAM}(x,y) = k/2$ from $\mathsf{HAM}(x,y) = k/2 + 1$ requires $\Omega(k\log n)$ space.
- Uses combinatorial arguments and Stirling's approximation to bound the number of strings with specific Hamming distances, showing that low-memory algorithms must err on a constant fraction of inputs.
- Relies on the structural insight that in the presence of mismatches, the classical periodicity properties (e.g., $\gcd(p,q)$ being a period) no longer hold, necessitating new algorithmic techniques.
Experimental results
Research questions
- RQ1Can $k$-periods be detected in a streaming model using sublinear space when the string may contain up to $k$ mismatches between its prefix and suffix?
- RQ2What is the minimal space complexity for a one-pass streaming algorithm to compute all $k$-periods of length at most $n/2$?
- RQ3Is it possible to design a two-pass streaming algorithm that computes all $k$-periods using only poly$(k, \log n)$ space, regardless of period length?
- RQ4What are the inherent space limitations of one-pass streaming algorithms for $k$-period detection, especially when $k = o(\sqrt{n})$?
- RQ5How do mismatches affect the structural properties of periodicity, and can these be exploited algorithmically to achieve space efficiency?
Key findings
- A one-pass streaming algorithm computes all $k$-periods of length at most $n/2$ using $\mathcal{O}(k^4 \log^9 n)$ space.
- A two-pass streaming algorithm computes all $k$-periods of any length using $\mathcal{O}(k^4 \log^9 n)$ space.
- Any one-pass streaming algorithm that computes all $k$-periods of a string $S$ requires $\Omega(n)$ space in the worst case.
- For $k = o(\sqrt{n})$ and $k > 2$, any one-pass algorithm that computes the smallest $k$-period with probability at least $1 - 1/n$ requires $\Omega(k\log n)$ space.
- The paper establishes a tight lower bound of $\Omega(k\log n)$ space for one-pass $k$-period detection under the promise that the $k$-period is at most $n/2$, showing the algorithm's space usage is asymptotically optimal in this regime.
- The structural breakdown of classical periodicity (e.g., $\gcd(p,q)$ being a period) under mismatches necessitates new algorithmic approaches, which the paper successfully develops.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.