Table of Contents
Fetching ...

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.

Compact representations of pattern-avoiding permutations

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 bits and supports and in constant time, independent of and . The construction runs in time, and the method extends to rectangle range counting in 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- permutation that avoids an arbitrary (and unknown) fixed pattern in the asymptotically optimal bits, where is the Stanley-Wilf limit of . Our data structure supports and queries in 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 time. This result circumvents the lower bound of 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.
Paper Structure (46 sections, 7 theorems, 10 equations, 10 figures)

This paper contains 46 sections, 7 theorems, 10 equations, 10 figures.

Key Result

Theorem 1.1

Any permutation $\tau$ of size $n$ that avoids a pattern $\pi$ can be represented in $\mathcal{O}(n\lg{s_\pi})$ bits, supporting $\tau(i)$ and $\tau^{-1}(i)$ queries in time $\mathcal{O}(1)$. Moreover, the representation can be constructed in $\mathcal{O}(n \lg{s_\pi})$ time.

Figures (10)

  • Figure 1: Permutation matrix $M$ of size $11 \times 11$ (left) with division $(\mathscr{R},\mathscr{C})$ and $M(\mathscr{R},\mathscr{C})$ (right), with $\mathscr{R} = (I_1,I_2,I_3)$, $\mathscr{C} = (J_1,J_2,J_3)$, and cell $M[I_3,J_2]$ framed. Here, $I_1 = [1,5], J_1 = [1,3], I_2 = [6,8], J_2=[4,8], I_3 = J_3 = [9,11]$. Dots correspond to $1$-entries, empty spaces to $0$-entries.
  • Figure 2: Decomposition of an $n \times n$ permutation matrix $M$ with a (coarse) division $(\mathscr{R}_1,\mathscr{C}_1)$ that is a coarsening of a (fine) division $(\mathscr{R}_2,\mathscr{C}_2)$. Column and row trees $T_C, T_R$ and column and row indices $I_C, I_R$ illustrated. A $2$-cell and corresponding nodes in $T_R$ and $T_C$ highlighted.
  • Figure 3: Left: column and row permutation mapping and their inverse. Value $k$ is the absolute offset of the query within the column or row; $c$ refers to the $c$-th non-zero cell within column or row (non-zero cells are shaded gray); $v$ is the vertical rank of the query within its cell, i.e., $v$ entries in cell are below query point. Right: $\mathsf{rowRank}$ method: the $c$-th non-zero cell of the $j$-th column is the $c'$-th non-zero cell of the $r$-th row; $\mathsf{parentCell}$ method invoked for a $\mathscr{C}_1$-column $C$: the $c$-th non-zero $2$-cell in the $j$-th $\mathscr{C}_2$-column in $C$ is in the $c"$-th non-zero cell of $C$.
  • Figure 4: Implementation of the rank and unrank queries.
  • Figure 5: From left to right: (i) $\mathsf{cellOffset}$ query in $\mathscr{C}_2$-column: for absolute offset $k$ and non-zero cell index $c$, we obtain the number of points $v$ left of the query; (ii) $\mathsf{rectCount}$ query in $\mathscr{C}_2$-column: returns number of points in rectangle with corners identified by horizontal offsets $i_1,i_2$, and vertical offsets $j_1,j_2$ within non-zero cells $c_1$ and $c_2$; (iii) $\mathsf{cellRank}$ and $\mathsf{nonEmpty}$ queries for a column $J$ (at arbitrary level), w.r. to cell in subcolumn $i$ of $J$ and subrow $j$ within non-zero cell $c$ of $J$; $\mathsf{cellRank}$ returns number of non-zero cells in marked area; (iv) $\mathsf{rectCount}$ query for a column $J$ (at arbitrary level), $i_1,i_2$ now refer to subcolumns within $J$ and $j_1,j_2$ refer to subrows within cells $c_1, c_2$ of $J$. Returns number of points in rectangle.
  • ...and 5 more figures

Theorems & Definitions (7)

  • Theorem 1.1
  • Theorem 1.2
  • Theorem 1.3
  • Corollary 1.4
  • Lemma 2.1
  • Lemma 2.2: Balanced Decomposition
  • Lemma 5.1