Table of Contents
Fetching ...

Counting Permutation Patterns with Multidimensional Trees

Gal Beniamini, Nir Lavee

TL;DR

This work advances permutation pattern counting by introducing pattern-trees, a versatile framework that generalizes corner-trees to capture linear combinations of pattern counts. The authors prove a subquadratic approach for computing the 5-, 6-, and 7-profiles via quadratic-time pattern-tree evaluation and a full-rank construction of trees up to size 2, while identifying a barrier at k=8. They also achieve a subquadratic O~(n^{7/4}) algorithm for the 5-profile by augmenting the evaluation with marked/weighted gadgets and a new pair-rectangle-tree data structure for dominance counting. The methods leverage rectangle-trees and sophisticated case analyses to count complex patterns, offering practical subquadratic techniques for small fixed k with clear paths for extension and open questions about higher k and rank behavior. Overall, the paper provides a unified, scalable framework for pattern-count vectors in permutations and highlights both achievable progress and inherent limitations as k grows.

Abstract

We consider the well-studied pattern counting problem: given a permutation $π\in \mathbb{S}_n$ and an integer $k > 1$, count the number of order-isomorphic occurrences of every pattern $τ\in \mathbb{S}_k$ in $π$. Our first result is an $\widetilde{\mathcal{O}}(n^2)$-time algorithm for $k=6$ and $k=7$. The proof relies heavily on a new family of graphs that we introduce, called pattern-trees. Every such tree corresponds to an integer linear combination of permutations in $\mathbb{S}_k$, and is associated with linear extensions of partially ordered sets. We design an evaluation algorithm for these combinations, and apply it to a family of linearly-independent trees. For $k=8$, we show a barrier: the subspace spanned by trees in the previous family has dimension exactly $|\mathbb{S}_8| - 1$, one less than required. Our second result is an $\widetilde{\mathcal{O}}(n^{7/4})$-time algorithm for $k=5$. This algorithm extends the framework of pattern-trees by speeding-up their evaluation in certain cases. A key component of the proof is the introduction of pair-rectangle-trees, a data structure for dominance counting.

Counting Permutation Patterns with Multidimensional Trees

TL;DR

This work advances permutation pattern counting by introducing pattern-trees, a versatile framework that generalizes corner-trees to capture linear combinations of pattern counts. The authors prove a subquadratic approach for computing the 5-, 6-, and 7-profiles via quadratic-time pattern-tree evaluation and a full-rank construction of trees up to size 2, while identifying a barrier at k=8. They also achieve a subquadratic O~(n^{7/4}) algorithm for the 5-profile by augmenting the evaluation with marked/weighted gadgets and a new pair-rectangle-tree data structure for dominance counting. The methods leverage rectangle-trees and sophisticated case analyses to count complex patterns, offering practical subquadratic techniques for small fixed k with clear paths for extension and open questions about higher k and rank behavior. Overall, the paper provides a unified, scalable framework for pattern-count vectors in permutations and highlights both achievable progress and inherent limitations as k grows.

Abstract

We consider the well-studied pattern counting problem: given a permutation and an integer , count the number of order-isomorphic occurrences of every pattern in . Our first result is an -time algorithm for and . The proof relies heavily on a new family of graphs that we introduce, called pattern-trees. Every such tree corresponds to an integer linear combination of permutations in , and is associated with linear extensions of partially ordered sets. We design an evaluation algorithm for these combinations, and apply it to a family of linearly-independent trees. For , we show a barrier: the subspace spanned by trees in the previous family has dimension exactly , one less than required. Our second result is an -time algorithm for . This algorithm extends the framework of pattern-trees by speeding-up their evaluation in certain cases. A key component of the proof is the introduction of pair-rectangle-trees, a data structure for dominance counting.
Paper Structure (42 sections, 13 theorems, 13 equations, 10 figures, 1 algorithm)

This paper contains 42 sections, 13 theorems, 13 equations, 10 figures, 1 algorithm.

Key Result

Theorem 1

For every $1 \le k \le 7$, the $k$-profile of an $n$-element permutation can be computed in $\widetilde{\mathcal{O}}\left( n^2 \right)$ time and space.

Figures (10)

  • Figure 1: An embedding of a pattern-tree (left) into the permutation $\mathtt{162478359} \in \mathbb{S}_9$ (right).
  • Figure 2: Two occurrences of a corner-tree (left) in $\pi = \mathtt{2471635} \in \mathbb{S}_7$ (centre, right). Occurrences need not be injective; for instance, on the right, the blue and green points are identified.
  • Figure 3: An occurrence of a pattern-tree $T$ (left) in the permutation $\pi = \mathtt{2471635} \in \mathbb{S}_7$ (right). Every set of coloured points on the right induces the permutation with which the similarly coloured vertex on the left is labeled ("vertex constraints"). All of the edge-constraints are also satisfied: points $p_v^2$ and $p_u^2$ are identified, and point $p_w^1$ (green) must reside within the red shaded square. This tree corresponds to a linear combination, ${\# \mathtt{1423} } + {\# \mathtt{2413} } + 2 \cdot {\# \mathtt{12534} } + \dots + {\# \mathtt{24513} }$, of patterns in $\mathbb{S}_4$ and $\mathbb{S}_5$. The tree has total size $\Sigma(T)=6$ and maximum size $s(T)=3$.
  • Figure 4: A non-trivial pattern $\tau = \mathtt{15372846} \in \mathbb{S}_8$. There are three ascending pairs in its quadrants, and one descending pair. Its halves are order-isomorphic to the non-trivial permutations, $\mathtt{1342}$ (top), $\mathtt{1324}$ (bottom, left) and $\mathtt{1423}$ (right).
  • Figure 5: Two "gadgets" in a pattern-tree. The left corresponds to a weighted marked pattern count of $\tau_u$, marked at $l$. The right corresponds to a (unweighted) marked pattern count of $\tau_u$.
  • ...and 5 more figures

Theorems & Definitions (29)

  • Theorem 1
  • Theorem 2
  • Definition 2.1
  • Proposition 2.2: chazelle1988functionaljaja2005space, see also dudek2020counting
  • Proposition 2.3
  • proof
  • Remark 2.4
  • Theorem 1
  • Definition 3.1: corner-tree even2021counting
  • Proposition 3.2: Theorem 1.1 of even2021counting
  • ...and 19 more