We consider the well-studied pattern counting problem: given a permutation $\pi \in \mathbb{S}_n$ and an integer $k > 1$, count the number of order-isomorphic occurrences of every pattern $\tau \in \mathbb{S}_k$ in $\pi$. 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.
翻译:我们研究了经典的置换模式计数问题:给定一个置换 $\pi \in \mathbb{S}_n$ 和一个整数 $k > 1$,计算 $\pi$ 中所有模式 $\tau \in \mathbb{S}_k$ 的序同构出现次数。我们的第一个结果是一个 $\widetilde{\mathcal{O}}(n^2)$ 时间算法,适用于 $k=6$ 和 $k=7$。该证明主要依赖于我们引入的一类新图,称为模式树。每个这样的树对应 $\mathbb{S}_k$ 中置换的一个整数线性组合,并与偏序集的线性扩展相关联。我们为这些组合设计了一个求值算法,并将其应用于一个线性无关的树族。对于 $k=8$,我们证明了一个障碍:前述树族所张成的子空间维度恰好为 $|\mathbb{S}_8| - 1$,比所需维度少一。我们的第二个结果是一个 $\widetilde{\mathcal{O}}(n^{7/4})$ 时间算法,适用于 $k=5$。该算法扩展了模式树的框架,通过在某些情况下加速其求值过程。证明的一个关键组成部分是引入了对矩形树,这是一种用于优势计数的数据结构。