On complexity of the subpattern problem

Shlomo Ahal, Yuri Rabinovich

Research output: Contribution to journalArticlepeer-review


We study various computational aspects of the problem of determining whether, given a (fixed) permutation π on k elements and an input permutation σ on n > k elements, π can be embedded in σ in an order-preserving manner. Formally, the goal is to determine whether there exists a strictly increasing function f from [1,k] to [l,n] which is order preserving, i.e., f satisfies σ(f(i)) > σ(f(j)) whenever π(i) > π(j). We call this decision problem the subpattern problem. The study falls into two parts. In the first part we develop and analyze an algorithmic paradigm for this problem. We introduce two naturally defined (related) permutation-complexity measures C(π) and a somewhat finer C T(π), and, we show that our algorithms run in time O(n 1+C(π)) and O(n2.CT (π)), respectively; i.e., the hardness of the problem crucially depends on the structure of π, as measured by C(π) or by CT(π). In the second part of the paper we study the above complexity measures. In particular, we show that in the general case, C(π) ≤ 0.47k + o(k). Thus, the time complexity of the subpattem problem is at most O(n0.47k+o(k)), improving over the trivial O(nk). Unfortunately, it turns out that for most permutations CT(π) = Ω(k), and thus, in general, the upper bound on the running time cannot be significantly improved using this approach. Yet, for many natural classes of permutations the complexity of C(π) is sublinear in k. To demonstrate this, we study two interesting classes of "linear" permutations and show that their complexity is C(π) = O(√k). In addition, we study some structural properties of the complexity measures, show that CT(π) ≤ C(π) ≤ O(log k) . CT(π), and relate C(π) and C T(π) to the pathwidth and the treewidth of a certain graph G π defined by the permutation π.

Original languageEnglish
Pages (from-to)629-649
Number of pages21
JournalSIAM Journal on Discrete Mathematics
Issue number2
StatePublished - Mar 2008


  • Forbidden pattern
  • Permutation
  • Recognition
  • Treewidth

ASJC Scopus subject areas

  • General Mathematics


Dive into the research topics of 'On complexity of the subpattern problem'. Together they form a unique fingerprint.

Cite this