Remote Access Mathematics of Computation
Green Open Access

Mathematics of Computation

ISSN 1088-6842(online) ISSN 0025-5718(print)

Request Permissions   Purchase Content 
 
 

 

Fast algorithms for finding pattern avoiders and counting pattern occurrences in permutations


Author: William Kuszmaul
Journal: Math. Comp.
MSC (2010): Primary 05A05; Secondary 68W01
DOI: https://doi.org/10.1090/mcom/3216
Published electronically: May 31, 2017
Full-text PDF

Abstract | References | Similar Articles | Additional Information

Abstract: Given a set $ \Pi $ of permutation patterns of length at most $ k$, we present an algorithm for building $ S_{\le n}(\Pi )$, the set of permutations of length at most $ n$ avoiding the patterns in $ \Pi $, in time $ O(\vert S_{\le n - 1}(\Pi )\vert \cdot k + \vert S_{n}(\Pi )\vert)$. Additionally, we present an $ O(n!k)$-time algorithm for counting the number of copies of patterns from $ \Pi $ in each permutation in $ S_n$. Surprisingly, when $ \vert\Pi \vert = 1$, this runtime can be improved to $ O(n!)$, spending only constant time per permutation. Whereas the previous best algorithms, based on generate-and-check, take exponential time per permutation analyzed, all of our algorithms take time at most polynomial per outputted permutation.

If we want to solve only the enumerative variant of each problem, computing $ \vert S_{\le n}(\Pi )\vert$ or tallying permutations according to $ \Pi $-patterns, rather than to store information about every permutation, then all of our algorithms can be implemented in $ O(n^{k+1}k)$ space.

Our algorithms extend to considering permutations in any set closed under standardization of subsequences. Our algorithms also partially adapt to considering vincular patterns.


References [Enhancements On Off] (What's this?)


Similar Articles

Retrieve articles in Mathematics of Computation with MSC (2010): 05A05, 68W01

Retrieve articles in all journals with MSC (2010): 05A05, 68W01


Additional Information

William Kuszmaul
Affiliation: Department of Computer Science, Stanford University, Stanford, California 94305
Email: william.kuszmaul@gmail.com

DOI: https://doi.org/10.1090/mcom/3216
Received by editor(s): October 6, 2015
Received by editor(s) in revised form: July 3, 2016, and September 19, 2016
Published electronically: May 31, 2017
Additional Notes: This research was conducted at the University of Minnesota Duluth REU and was supported by NSF grant 1358659 and NSA grant H98230-13-1-0273. Machine time was provided by an AWS in Education Research grant.
Article copyright: © Copyright 2017 American Mathematical Society