Skip to main content
QUICK REVIEW

[Paper Review] Approximate Hamming Distance in a Stream

Clifford, Raphaël, Starikovskaya, Tatiana|arXiv (Cornell University)|Sep 24, 2011
Algorithms and Data CompressionComputer Science12 references3 citations
TL;DR

This paper presents a streaming algorithm for parameterized pattern matching that achieves constant-time processing per stream symbol and sublinear, near-optimal space usage with high probability. By exploiting the p-periodicity of patterns and using a buffer-based approach with arithmetic progressions to represent matches, the method efficiently tracks parameterized matches in real time, marking a significant advance beyond prior sublinear-space limits in streaming pattern matching.

ABSTRACT

We consider the problem of computing a (1+epsilon)-approximation of the Hamming distance between a pattern of length n and successive substrings of a stream. We first look at the one-way randomised communication complexity of this problem. We show the following: - If Alice and Bob both share the pattern and Alice has the first half of the stream and Bob the second half, then there is an O(epsilon^{-4}*log^2(n)) bit randomised one-way communication protocol. - If Alice has the pattern, Bob the first half of the stream and Charlie the second half, then there is an O(epsilon^{-2}*sqrt(n)*log(n)) bit randomised one-way communication protocol. We then go on to develop small space streaming algorithms for (1 + epsilon)-approximate Hamming distance which give worst case running time guarantees per arriving symbol. - For binary input alphabets there is an O(epsilon^{-3}*sqrt(n)*log^2(n)) space and O(epsilon^{-2}*log(n)) time streaming (1 + epsilon)-approximate Hamming distance algorithm. - For general input alphabets there is an O(epsilon^{-5}*sqrt(n)*log^4(n)) space and O(epsilon^{-4}*log^3(n)) time streaming (1 + epsilon)-approximate Hamming distance algorithm.

Motivation & Objective

  • To solve parameterized pattern matching in a streaming model with minimal space and time complexity.
  • To overcome the longstanding Ω(m) space barrier that limits most streaming pattern matching problems.
  • To demonstrate that sublinear, near-optimal space solutions are possible for a more complex problem than exact matching.
  • To provide a practical and efficient method for detecting parameterized matches in real-time data streams.

Proposed method

  • Leverages the p-period of the pattern to identify structural repetitions that enable efficient match detection.
  • Uses a buffer of size O(|ΣP| + ρ) to store candidate match positions, where ρ is the p-period and |ΣP| is the number of distinct symbols in the pattern.
  • Applies a predecessor string transformation to convert parameterized matching into a problem of exact string periodicity.
  • Identifies matches as either isolated positions (stored in set Y) or part of an arithmetic progression (represented by set A) with period ρ.
  • Employs a rolling fingerprint technique to maintain and update match information incrementally as new stream symbols arrive.
  • Proves that matches beyond a certain range form an arithmetic progression with period ρ, enabling compact representation.

Experimental results

Research questions

  • RQ1Can parameterized pattern matching be solved in sublinear space in the streaming model, despite known Ω(m) lower bounds for many related problems?
  • RQ2Is it possible to achieve constant-time processing per stream symbol for parameterized matching while using significantly less than Θ(m) space?
  • RQ3What structural properties of the pattern (e.g., p-periodicity) can be exploited to reduce space and time complexity in streaming pattern matching?
  • RQ4How can matches be represented compactly when they occur in periodic patterns, enabling efficient storage and update?

Key findings

  • The algorithm achieves constant-time processing per arriving stream symbol with high probability.
  • Space usage is sublinear and near-optimal, bounded by O(|ΣP| + ρ) for the buffer, which is significantly less than Θ(m) in many cases.
  • The number of matches in any window of length 3m/2 is bounded by O(|ΣP|), enabling efficient storage and representation.
  • Matches beyond a certain offset are shown to form an arithmetic progression with period ρ, allowing compact representation.
  • The method provides the first sublinear-space solution for parameterized matching in streaming, breaking the Ω(m) space barrier for a non-trivial pattern matching problem.
  • The approach is robust even when only a small subset of symbols are relabelled, further reducing space usage.

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.