Table of Contents
Fetching ...

Inapproximability of Counting Permutation Patterns

Michal Opler

TL;DR

It is shown that, under ETH, no algorithm running in time can approximate the number of copies of a length-$k$ pattern within a multiplicative factor $n^{(1/2-\varepsilon)k}$ and the obtained bound on the multiplicative error factor is essentially tight.

Abstract

Detecting and counting copies of permutation patterns are fundamental algorithmic problems, with applications in the analysis of rankings, nonparametric statistics, and property testing tasks such as independence and quasirandomness testing. From an algorithmic perspective, there is a sharp difference in complexity between detecting and counting the copies of a given length-$k$ pattern in a length-$n$ permutation. The former admits a $2^{\mathcal{O}(k^2)} \cdot n$ time algorithm (Guillemot and Marx, 2014) while the latter cannot be solved in time $f(k)\cdot n^{o(k/\log k)}$ unless the Exponential Time Hypothesis (ETH) fails (Berendsohn, Kozma, and Marx, 2021). In fact already for patterns of length 4, exact counting is unlikely to admit near-linear time algorithms under standard fine-grained complexity assumptions (Dudek and Gawrychowski, 2020). Recently, Ben-Eliezer, Mitrović and Sristava (2026) showed that for patterns of length up to 5, a $(1+\varepsilon)$-approximation of the pattern count can be computed in near-linear time, yielding a separation between exact and approximate counting for small patterns, and conjectured that approximate counting is asymptotically easier than exact counting in general. We strongly refute their conjecture by showing that, under ETH, no algorithm running in time $f(k)\cdot n^{o(k/\log k)}$ can approximate the number of copies of a length-$k$ pattern within a multiplicative factor $n^{(1/2-\varepsilon)k}$. The lower bound on runtime matches the conditional lower bound for exact pattern counting, and the obtained bound on the multiplicative error factor is essentially tight, as an $n^{k/2}$-approximation can be computed in $2^{\mathcal{O}(k^2)}\cdot n$ time using an algorithm for pattern detection.

Inapproximability of Counting Permutation Patterns

TL;DR

It is shown that, under ETH, no algorithm running in time can approximate the number of copies of a length- pattern within a multiplicative factor and the obtained bound on the multiplicative error factor is essentially tight.

Abstract

Detecting and counting copies of permutation patterns are fundamental algorithmic problems, with applications in the analysis of rankings, nonparametric statistics, and property testing tasks such as independence and quasirandomness testing. From an algorithmic perspective, there is a sharp difference in complexity between detecting and counting the copies of a given length- pattern in a length- permutation. The former admits a time algorithm (Guillemot and Marx, 2014) while the latter cannot be solved in time unless the Exponential Time Hypothesis (ETH) fails (Berendsohn, Kozma, and Marx, 2021). In fact already for patterns of length 4, exact counting is unlikely to admit near-linear time algorithms under standard fine-grained complexity assumptions (Dudek and Gawrychowski, 2020). Recently, Ben-Eliezer, Mitrović and Sristava (2026) showed that for patterns of length up to 5, a -approximation of the pattern count can be computed in near-linear time, yielding a separation between exact and approximate counting for small patterns, and conjectured that approximate counting is asymptotically easier than exact counting in general. We strongly refute their conjecture by showing that, under ETH, no algorithm running in time can approximate the number of copies of a length- pattern within a multiplicative factor . The lower bound on runtime matches the conditional lower bound for exact pattern counting, and the obtained bound on the multiplicative error factor is essentially tight, as an -approximation can be computed in time using an algorithm for pattern detection.
Paper Structure (18 sections, 5 theorems, 11 equations, 3 figures)

This paper contains 18 sections, 5 theorems, 11 equations, 3 figures.

Key Result

Theorem 1.1

For arbitrary $0 < \varepsilon < 1/2$, an algorithm computing the number of copies of a given $k$-pattern with $n^{(1/2-\varepsilon) \cdot k}$-multiplicative error in $f(k) \cdot n^{o(k/\log k)}$ time would refute ETH.

Figures (3)

  • Figure 1: (a) Permutation $24153$ with a highlighted copy of the pattern $312$, (b) a left-aligned copy of the pattern $213$, (c) the inflation of $132$ by $21$, $1$ and $123$, and (d) a layered permutation with highlighted layers.
  • Figure 2: Illustration of the reduction in \ref{['thm:appm-hard']}. The permutations $\pi$ and $\tau$ are obtained as reductions of a small clockwise rotation of the point sets $P$ and $T$ respectively.
  • Figure 3: Illustration of the reduction in \ref{['thm:gap-hard']}. The initial blocks in both permutations $\pi'$ and $\tau'$ of the produced instance are highlighted.

Theorems & Definitions (9)

  • Theorem 1.1
  • Theorem 3.1
  • proof : Proof of \ref{['thm:appm-hard']}
  • Theorem 3.2: BerendsohnKM21
  • proof : Alternative proof of \ref{['thm:sppm-hard']}
  • Theorem 4.1
  • proof
  • Theorem 4.1
  • proof