Compact representations of pattern-avoiding permutations
László Kozma, Michal Opler
TL;DR
We address storing pattern-avoiding permutations in asymptotically optimal space while enabling fast access. The core approach is a two-level balanced decomposition (merging adjacent rows/columns) that yields a representation using $O(n\log s_{\pi})$ bits and supports $\tau(i)$ and $\tau^{-1}(i)$ in constant time, independent of $n$ and $\pi$. The construction runs in $O(n\log s_{\pi})$ time, and the method extends to rectangle range counting in $O(\log\log n)$ time, as well as to bounded-treewidth classes with additive space improvements; extensions to geometric queries and related classes are discussed. The results advance compact representations beyond separable or Baxter permutations, leveraging structured decompositions to bypass general lower bounds and enabling near-linear time construction. The work has implications for efficient pattern-avoidance processing, adaptive sorting, and geometric query support in specialized permutation classes.
Abstract
Pattern-avoiding permutations are a central object of study in both combinatorics and theoretical computer science. In this paper we design a data structure that can store any size-$n$ permutation $τ$ that avoids an arbitrary (and unknown) fixed pattern $π$ in the asymptotically optimal $O(n \lg{s_π})$ bits, where $s_π$ is the Stanley-Wilf limit of $π$. Our data structure supports $τ(i)$ and $τ^{-1}(i)$ queries in $O(1)$ time, sidestepping the lower bound of Golynski (SODA 2009) that holds for general permutations. Comparable results were previously known only in more restricted cases, e.g., when $τ$ is separable, which means avoiding the patterns 2413 and 3142. We also extend our data structure to support more complex geometric queries on pattern-avoiding permutations (or planar point sets) such as rectangle range counting in $O(\lg\lg{n})$ time. This result circumvents the lower bound of $Ω{(\lg{n}/\lg\lg{n})}$ by Pătraşcu (STOC 2007) that holds in the general case. For bounded treewidth permutation classes (which include the above-mentioned separable class), we further reduce the space overhead to a lower order additive term, making our data structure succinct. This extends and improves results of Chakraborty et al. (ISAAC 2024) that were obtained for separable permutations via different techniques. All our data structures can be constructed in linear time.
