Strongly Sublinear Algorithms for Testing Pattern Freeness
Ilan Newman, Nithin Varma
TL;DR
This work advances the study of pattern freeness testing by giving adaptive, one-sided ε-testers for π-freeness of constant-length permutations with subpolynomial query complexity in $n$, thus outperforming known nonadaptive bounds. The key technique is a grid-based reduction that represents $f$ on a coarse $m\times m$ grid and analyzes configurations of nonempty boxes to witness π-appearances, aided by Marcus–Tardos-type bounds and erasure-resilient testing for smaller subpatterns. The authors develop a generalized testing framework that handles φ-legged ν-appearances within components, enabling recursion on smaller patterns and across scales, while maintaining rigorous correctness and controlled query complexity. This approach yields a substantial separation between adaptive and nonadaptive testing in the π-freeness setting and lays groundwork for further refinements to broader pattern classes and weaker notions of distance. The results have potential implications for sublinear testing of complex combinatorial patterns and time-series motif discovery, illustrating how gridding and hierarchical testing can achieve subpolynomial query costs on large inputs.
Abstract
For a permutation $π:[k] \to [k]$, a function $f:[n] \to \mathbb{R}$ contains a $π$-appearance if there exists $1 \leq i_1 < i_2 < \dots < i_k \leq n$ such that for all $s,t \in [k]$, $f(i_s) < f(i_t)$ if and only if $π(s) < π(t)$. The function is $π$-free if it has no $π$-appearances. In this paper, we investigate the problem of testing whether an input function $f$ is $π$-free or whether $f$ differs on at least $\varepsilon n$ values from every $π$-free function. This is a generalization of the well-studied monotonicity testing and was first studied by Newman, Rabinovich, Rajendraprasad and Sohler (Random Structures and Algorithms 2019). We show that for all constants $k \in \mathbb{N}$, $\varepsilon \in (0,1)$, and permutation $π:[k] \to [k]$, there is a one-sided error $\varepsilon$-testing algorithm for $π$-freeness of functions $f:[n] \to \mathbb{R}$ that makes $\tilde{O}(n^{o(1)})$ queries. We improve significantly upon the previous best upper bound $O(n^{1 - 1/(k-1)})$ by Ben-Eliezer and Canonne (SODA 2018). Our algorithm is adaptive, while the earlier best upper bound is known to be tight for nonadaptive algorithms.
