Pattern Avoidance in Task-Precedence Posets

We have extended classical pattern avoidance to a new structure: multiple task-precedence posets whose Hasse diagrams have three levels, which we will call diamonds. The vertices of each diamond are assigned labels which are compatible with the poset. A corresponding permutation is formed by reading these labels by increasing levels, and then from left to right. We used Sage to form enumerative conjectures for the associated permutations avoiding collections of patterns of length three, which we then proved. We have discovered a bijection between diamonds avoiding 132 and certain generalized Dyck paths. We have also found the generating function for descents, and therefore the number of avoiders, in these permutations for the majority of collections of patterns of length three. An interesting application of this work (and the motivating example) can be found when task-precedence posets represent warehouse package fulfillment by robots, in which case avoidance of both 231 and 321 ensures we never stack two heavier packages on top of a lighter package.


Introduction
In this paper, we continue a rich tradition of extending the notion of classical pattern avoidance in permutations to other structures. Given permutations π = π 1 π 2 · · · π n and ρ = ρ 1 ρ 2 · · · ρ m we say that π contains ρ as a pattern if there exist 1 ≤ i 1 < i 2 < · · · < i m ≤ n such that π ia < π i b if and only if ρ a < ρ b . In this case we say that π i1 π i2 · · · π im is order-isomorphic to ρ and that π i1 π i2 · · · π im reduces to ρ. If π does not contain ρ, then π is said to avoid ρ. The classical definition of pattern avoidance in permutations has shown itself to be worthwhile in many fields including algebraic geometry [17] and theoretical computer science [9]. Analogues of pattern avoidance have been developed for a variety of combinatorial objects including Dyck paths [1], tableaux [11], set partitions [15], trees [14], posets [8], and many more. We use a definition of pattern avoidance that is similar to that used in the study of heaps [10], but distinct from that used in previous studies of trees. Unlike the question studied by Hopkins and Weiler [8] which identified classes of rightmost diamond for retrieving object 3. The labels represent the order in which each task of the 12 total tasks is executed. Each robot operates autonomously and independently, and each faces its own challenges. For example one of the objects may be at the back of the warehouse, there may be significant traffic along some of the paths the robots travel through the warehouse, or the robot assigned to retrieve an object may still be executing its previous assignment. Thus the labels on the least elements of each diamond can vary significantly, and there can be a large difference in the labelling of the least element of a particular diamond and its greatest element. In Figure 1.2, the first task completed is that the robot for object 3 arrives and picks up the rack containing object 3. Next, the robot retrieving object 1 arrives at the rack containing object 1. Next, the robot carrying object 1 rotates its rack on its back to have the correct orientation to the picker. This continues, and based on the labelling of the elements, we see that object 3 (the lightest) is placed in its shipping box first (in step 9), then object 1 (in step 11), and then object 2 (in step 12). So our human picker has placed two heavier objects on a lighter object (unless they rearrange the objects after packing). Then a a sufficient (though not necessary) condition to ensure that two heavier objects do not arrive after a lighter object is that the associated permutation avoid 231 and 321. One could consider other applications that arise from task-precedence problems, but our motivating example can be generalized most appropriately by changing 4 tasks per autonomous robot to v tasks.
Throughout this paper, the main question we answer is "How many elements are in D v,d (P )?" for any collection P of patterns of length 3. In general we fix v ≥ 4 and a set of patterns P and then determine a formula for the sequence {|D v,d (P )|} d≥1 , with key results for v = 4 shown in Table 1. The third column of the table gives entries from the Online Encyclopedia of Integer Sequences [13]. Our results for pattern-avoiding diamonds have connections with many other combinatorial objects, as evidenced by the low reference numbers. Sequences A260331, A260332 and A260579, however, are new results particular to this study of task precedence posets.
Our task, which answers our primary question, is to find f P v,d (x, y). Then when we substitute x = 1 and take the coefficient of y d , we obtain |D v,d (P )|.
In Section 2 we consider collections of diamonds that avoid a single pattern of length 3. In Section 3 we consider collections of diamonds that avoid a pair of patterns of length 3, and in Section 4 we consider collections of diamonds avoiding three or more patterns of length 3. Finally in Section 5, we list some open problems relating to this work. 2 Diamonds avoiding a single pattern of length 3 Before we count pattern-avoiding diamonds, it is useful to enumerate all diamonds.

Proof:
Let v ≥ 4 and d ≥ 1, first we choose v labels for each diamond, and then there are (v − 2)! ways to arrange the internal vertex labels of any given diamond. We obtain Proof: It is impossible to avoid 123 while having a diamond since the pattern is inherent in all valid diamond labellings.

The patterns 132 and 213
The complement of a permutation π of length n, denoted by π c , is obtained by replacing each letter j by the letter n − j + 1. The reverse of π = π 1 π 2 . . . π n , denoted by π r , is π n π n−1 . . . π 1 . We let π rc be the reverse-complement of π and D v,d (p) rc be {π rc D | D ∈ D v,d (p)}. Given a permutation π in S n , lis(π) is the length of a longest increasing subsequence in π. For example, in the permutation 1 2 5 6 3 4 7 8 a longest increasing subsequence is 1 2 5 6 7 8 and lis(1 2 5 6 3 4 7 8) = 6. Given a permutation π in S n , rlmax(π) is the number of right-left maxima in π. For example, in the permutation 2 4 6 8 1 3 5 7 a maximum is reached when reading right-to-left twice and rlmax(2 4 6 8 1 3 5 7) = 2. Let Dyck v,d be the set of all paths from (0, 0) to (d, vd) using only (0, 1) and (1, 0) steps (East and North steps) which stay weakly under y = vx. Given any p ∈ Dyck v,d , touchpoints(p) is the number of times p touches the line y = vx, excluding the point (v, vd). In Figure 2.1, the Dyck path touches the line y = 4x three times and touchpoints(p) = 3. Given any p ∈ Dyck v,d , corners(p) is the number of North steps that are followed by one or more East steps in p. In Figure 2.1, there are three places where the Dyck path has one or more North steps followed by one or more East steps and corners(p) = 3. Given any p ∈ Dyck v,d , height(p) is the greatest vertical distance from any point on p to the line y = vx. In figure 2.1, the longest distance from a corner in the Dyck path to the line y = 4x is seven (from (3,5) to (3,12)) and height(p) = 7.

Lemma 1. Any element of D v,d (132) has the elements on each diamond labelled in increasing order.
Otherwise the label of the first element of the diamond together with the first descent would form a 132 pattern.

Proof:
We define a map φ from Dyck v,d to D v,d (132). To find φ(p), first write out the heights of the East steps. For each height, include a subscript j that indicates how many East steps are at that height. Reverse this sequence and add 1 to every item in the list, leaving the subscripts unchanged. Each of the elements of this list becomes the first label of a diamond, and then place vj labels in increasing order using the smallest elements that have not already been used as labels.
This map is certainly reversible, with the first label on each diamond forming a list, unless there is an increase between diamonds, in which case the first label is repeated. Then the list is reversed and 1 is subtracted from each element, giving us the heights of the East steps in the Dyck path.
This bijection is particularly natural when you examine common statistics on both paths and permutations. Following touchpoints, corners, and height through the bijection, we find they correspond exactly to rightleft maximum, descents, and longest increasing sequence on the permutation.
Proof: These equalities hold by the bijection in Theorem 3 and trivial Wilf equivalence from Proposition 1.

The patterns 231 and 312
Consider D in D v,d (231), and suppose label vd occurs in position k. Then for all i < k and for all j > k, a i < a j . Consequently, if label vd is in position k, then labels (1, . . . , k − 1) appear in positions (1, . . . , k − 1). We define D d v,j to be the collection of labelled diamonds for d − 1 full diamonds with v vertices each followed by an incomplete diamond with j vertices for j = 1, . . . , v − 1. Likewise D d v,j (p) are those diamonds that avoid pattern p. Note, when j = 1 there exist no order relations in the final partial diamond. An example is shown in Figure 2 x des(πD ) .
and C i is the i th Catalan number. will avoid 231. When m appears on the greatest element of the i th complete diamond, 1/leqi/leqd − 1, we have α i v,v−1 as the gfd for the vertices before m, and α d−i v,1 as the gfd for the vertices following m. Because we have created a descent from m to the least element of the next diamond or partial diamond, we must also multiply by x to account for this extra descent. Hence Now, assume we have (d − 1) diamonds followed by an incomplete diamond with j vertices where j = 2, . . . , v − 1. The m th element can appear on any of the interior vertices but not on the least element of the incomplete diamond, or m can appear on the greatest element of any complete diamond. When m appears on any of the interior vertices of the final diamond we need to count the descents before m, after m, and from m itself. The descents that occur before m can be counted by α d v,j−g where g is the number of interior vertices following m including m. The descents following m are counted by α 1 v,g because the same number of descents can occur in the remaining interior vertices as when we have a single incomplete diamond. We then count the descent that results from m by multiplying our gfd by x, but we do not get a descent from m when it appears on the final interior vertex. We then sum over all possible values of g to give us the gfd when m appears on the interior vertices of the final diamond which gives us Also, m can appear on the greatest element of any of the full diamonds. When m appears on the greatest element of the i th complete diamond the gfd for vertices that appear before m is α i v,(v−1) and α d−i v,j for the vertices following m. We count the descent from m by multiplying our gfd by x. The total gfd when m appears on the greatest element of the i th diamond is then

Tab. 2:
The recursive steps necessary to find the generating function for descents in D5,3(231). Thus Lastly, we look at when we have d complete diamonds. The m th element can appear on any of the greatest elements. When m appears on the greatest element of the last diamond, the gfd is α d v,(v−1) which counts descents before m.
When m appears on the greatest element of the i th complete diamond (1 ≤ i ≤ d − 1), the gfd for vertices that appear before m is α i v,(v−1) and α d−i v,v for vertices following m. We count the descent from m to the following least element by multiplying the gfd by x. Hence We can use this result to recursively obtain f 231 v,d (x, 1) for any v and d.

The pattern 321
We were unable to find a closed formula for the pattern 321. In Table 4, we present the first few terms of the sequence and the first few generating functions for descents, which we found using Sage. We are 3 Diamonds avoiding a pair of patterns of length 3 Next, we study pairs of patterns of length 3. While there are 15 such pairs of patterns, we focus on the 8 pairs of patterns σ, ρ where |D v,d (σ, ρ)| is non-trivial.

Diamonds avoiding the set of patterns 132, 213
Lemma 2. In order to avoid 132 and 213, the labels on each diamond must be increasing and consecutive.
Proof: By Lemma 1, the labels appear in increasing order on each diamond. Then any label "missing" from consecutive labelling would either create 213 if it occurred before its surrounding labels, or a 132 if it occurred after. Therefore the labels on each diamond must be consecutive and increasing. .
Proof: By Lemma 2, we know that the labels on each diamond are consecutive and increasing, so there is a diamond labelled 1, 2, . . ., v, another labelled v + 1, . . ., 2v, etc. So the only thing we must ensure is that the entire collection of diamonds avoids 132 and 213 between the respective diamonds. In their foundational paper, Simion and Schmidt enumerated permutations avoiding 132 and 213 [16], and the recursive nature of their proof can also be adapted to find our generating function for descents. The labels v(d − 1) + 1, . . . , vd must occur on either the first diamond, or the last. In the first case, they create a descent. In the second, they do not, giving a (1 + x) term in the generating function. We continue recursively and obtain:

Proof:
We proceed similarly to the proof of Theorem 5 with a recursive argument. By Lemma 2, the final diamond has only two possibilities, one of which forms a descent with the previous diamond, and one of which doesn't. Thus our descent generating function gains a (1 + x) term for each additional diamond, and exactly as in Theorem 5, the result follows. Proof: By examination of cases, any arrangement of two descents forms either a 132 or a 321. If a descent does not involve the 1, then either the 1 occurs before, causing a 132, or the 1 occurs after, causing a 321.

Proof:
By Lemma 4, we need only enumerate those diamonds with one descent where the descent involves the 1. Everything after the 1 increases, as does everything before the 1. In fact, the permutations associated to diamonds that avoid 132 and 321 look like a portion of the identity permutation was deleted from the front and .
Proof: Let n = vd be the largest label on a diamond D ∈ D v,d (231, 312). Avoiding the pattern 231 means the 1 must be at the beginning and avoiding the pattern 312 implies everything after n must be decreasing which forces n to the end of the permutation. By a result of Simion and Schmidt on permutations, there are 2 v−3 ways to arrange the middle-level vertices within each of the d diamonds in order to avoid both 231 and 312 creating between 0 and v − 3 descents [16]. There are also two ways to either swap or not swap the last element of each diamond with the first element of the next. This gives the following generating function.

Avoiding 231, 321
Lemma 5. All labels that appear after n = vd must be consecutive and increasing, and if a n = n, then a n = n − 1. Theorem 9.
is the generating function for descents for D v,d (231, 321).

Proof:
We approach the proof similarly to that of Theorem 4 and partition our diamonds by the position of the largest element and proceed recursively. Because the proofs are very similar, we omit the details of this proof for brevity. The only differences are that since we are now avoiding 321, we have no descents after the appearance of the largest label, and we have different initial conditions on one diamond. Table 5 is an example of using this recursive technique to find the generating function for descents in D 5,3 (231, 321). Tab Proof: Let n = vd be the largest label in d diamonds with v vertices. Avoiding the pattern 132 forces all labels before n to be larger than all labels after. Avoiding the pattern 213 forces all labels before n to be increasing. Avoiding the pattern 321 forces all labels after n to be increasing. This indicates that all vertices that appear before n will be the consecutive numbers prior to n and all vertices after n will be the remaining elements ordered consecutively. A label a i = n iff i = vs for some s = 1, . . . , d, and there is only one arrangement for the rest of the elements. Therefore, there can only be, at most, one descent and it occurs between diamonds. So,

Diamonds avoiding 231, 312, 321
We will proceed by examining what changes can be made to the identity permutation while still avoiding 231, 312, and 321.

Lemma 6.
For labels a i , a j , a k if a i , a j < a k , then i < k or j < k in order to avoid the patterns 312 and 321.
A swap is when two consecutive labels from the identity permutation switch positions in the permutation. Since any permutation can be created from the identity using swaps, restricting our changes to swaps will not exclude any possibilities.

Lemma 7.
All swaps must be disjoint in order to avoid 321.

Proof:
We simply examine the cases when two swaps overlap in some way, either with two swaps executed on 3 elements, or two overlapping swaps on 4 elements.
Proof: Every final element of a diamond can either remain unchanged or be swapped with the least element of the next diamond. This then gives the generating function (1 + x) d−1 for each possible swap. Let k represent the nonconsecutive positions from which to choose a swap among the interior vertices. Note that in a diamond there are v−3 positions to swap since there are v−2 interior vertices. By Lemma 6 and Lemma 7 any consecutive interior vertices can only be swapped disjointly. Since the swaps must be nonconsecutive, k must be chosen from v − 3 − (k − 1). This gives v−2−k k . We then sum over all k in order to generate all possible descents for a single diamond. Since we have d diamonds in which to execute these swaps, we raise to the d th power. The gfd for D v,d (231, 312, 321) is then Proof: Let n be the largest label in any permutation. Due to the structure of the diamonds, any set of permutations involving 123 cannot be avoided. For any other collection of 4 or more patterns, the result is easily seen using the lemmas for avoiding a single pattern earlier in the paper.

Open problems
This investigation leaves several directions open for future study. We did not touch on patterns of length 4, they all remain open. We are confident the techniques of Bevan et.al. [2] will give the growth rate and minimal polynomial for diamonds avoiding 321, but in addition it is likely that these techniques would also work for some patterns of length 4. Although the minimal polynomials are unlikely to generalize, the transition operators in particular cases could potentially even generalize to length k for the decreasing pattern k k − 1 . . . 2 1. There are also a wide variety of other poset classes that could be approached in this manner other than diamonds. We generalized our diamonds by adding additional elements and order relations between the least and greatest elements, but one could also imagine creating a diamond-type poset with more than 3 levels as another generalization.