Skip to content

Range Queries for Permutation Pattern Matching: Separations, Equivalences, and Applications

Omri Ben-Eliezer, Tomer Even

cs.DS

Abstract

The problem of Permutation Pattern Matching (PPM) asks, given a permutation π:[n]→[n]π:[n]\to[n], viewed as the point set P={(i,π(i)):i∈[n]}P=\{(i,π(i)):i\in[n]\}, and a pattern σσ of small length kk, whether PP contains an order-isomorphic copy of σσ. The PPM problem and its (exact and approximate) counting variants have been studied extensively in the literature. We consider a preprocessing-query version: after preprocessing PP, one must determine whether a query P'\subseteq P contains σσ, where P' is obtained by intersecting PP with a geometric shape (e.g., an axis-aligned rectangle or kk such rectangles). This naturally generalizes the classical range query problem in computational geometry, which corresponds to the case ∣σ∣=1|σ|=1. We extend the study of this problem from patterns of length 22 to patterns of length 33 (and in some cases beyond), and prove new fine-grained equivalences, separations, and applications: (1) Single rectangle: For all patterns of length 33, detection can be done with O~(n)\tilde{O}(n) preprocessing and O~(1)\tilde{O}(1) query time. The proof goes through a new tool of independent interest: reductions from rectangle queries to a simpler family of slab queries. (2) Multiple rectangles: For σ=132σ=132, detection is equivalent to the online set disjointness problem; we also show connections to online kk-set disjointness. To our knowledge, this is the first equivalence between a PPM-type problem and online set disjointness, a problem playing a fundamental role in fine-grained complexity. (3) Counting: As applications, we obtain an O(n1.725)O(n^{1.725}) time algorithm for exact counting of 55-patterns based on the rectangle-to-slab reduction, improving upon [Beniamini and Lavee, ICALP 2025], and an O~(n7/4)\tilde{O}(n^{7/4}) approximate counting algorithm for 66-patterns, the first to break the O(n2)O(n^2) barrier for 66-patterns.

Create a lesson