🤖 AI Summary
This paper studies the streaming Permutation Pattern Matching (PPM) problem: deciding whether a target permutation τ, presented as a single-pass stream of elements, contains a given pattern π. Addressing structural variations in π, we establish for the first time that deterministic lookahead—exploiting knowledge of future elements in the stream—enables space reduction, circumventing limitations of conventional lower-bound techniques in the streaming model. Through combinatorial analysis and tailored streaming algorithm design, we develop a structure-driven framework: achieving Θ(k log n) optimal space for monotone patterns; improving to O(√(n log n)) for specific ternary non-monotone patterns; and proving that, except for monotone patterns, all others require quasi-linear space in the streaming setting. Our results systematically characterize the intrinsic relationship between pattern structure and space complexity.
📝 Abstract
Permutation patterns and pattern avoidance are central, well-studied concepts in combinatorics and computer science. Given two permutations $τ$ and $π$, the pattern matching problem (PPM) asks whether $τ$ contains $π$. This problem arises in various contexts in computer science and statistics and has been studied extensively in exact-, parameterized-, approximate-, property-testing- and other formulations.
In this paper, we study pattern matching in a emph{streaming setting}, when the input $τ$ is revealed sequentially, one element at a time. There is extensive work on the space complexity of various statistics in streams of integers. The novelty of our setting is that the input stream is emph{a permutation}, which allows inferring some information about future inputs. Our algorithms crucially take advantage of this fact, while existing lower bound techniques become difficult to apply.
We show that the complexity of the problem changes dramatically depending on the pattern~$π$. The space requirement is: $Θ(klog{n})$ for the monotone patterns $π= 12dots k$, or $π= kdots21$, $O(sqrt{nlog{n}})$ for $πin {312,132}$, $O(sqrt{n} log n)$ for $πin {231,213}$, and $widetildeΘ_π(n)$ for all other $π$. If $τ$ is an arbitrary sequence of integers (not necessary a permutation), we show that the complexity is $widetildeΘ_π(n)$ in all except the first (monotone) cases.