A generating algorithm for ribbon tableaux and spin polynomials

We describe a general algorithm for generating various families of ribbon tableaux and computing their spin polynomials. This algorithm is derived from a new matricial coding. An advantage of this new notation lies in the fact that it permits one to generate ribbon tableaux with skew shapes. This algorithm permits us to compute quickly big LLT polynomials in MuPAD-Combinat.


Introduction
Ribbon tableaux are planar structures generalizing Young tableaux (see [5,10] for the classical case).These are tilings of Ferrers's diagram by ribbons (diagrams with special shape) labelled with integers verifying some vertical and horizontal monotonicity conditions.
Standard ribbon tableaux (all labels different) have first been introduced by Stanton and White in 1985, in order to explain some combinatorial properties of colored permutations [11].Semistandard ribbon tableaux (repeated labels are allowed) go back to the work of Lascoux, Leclerc and Thibon [8].These authors were motivated by the introduction of q-analogues of certain combinatorial identities, and in particular of the famous Littlewood-Richardson rule describing products of Schur functions.They obtained q-analogues of decomposition coefficients for any product of Schur functions and many questions about these q-coefficients are still open.
Studying ribbon tableaux is quite a difficult subject, which mainly uses huge numerical experimentations.This is why we are interested in finding efficient algorithms for generating and computing statistics on them.
The matricial coding of ribbon tableaux used for numerical experimentations in [8,9] is deficient because it does not give some elementary properties (shape and position of the head of the ribbons for example) without additional computations and cannot be generalized to skew shapes.The algorithm used at the time was not published and appeared only as a programming example with Maple/ACE in [6] and a distributed version is described in [13].
The aim of this paper is to present a more general algorithm for generating ribbon tableaux and computing spin polynomials, using a different and more transparent coding for ribbon tableaux.These algorithms are implemented in the combinatorial library MuPAD-Combinat [4] which can be downloaded at http://mupad-combinat.sourceforge.net/.

Basic definitions on ribbon tableaux
We will mainly follow [1,5,10] for classical notions on partitions and tableaux and [10] for notations related to partitions.Let λ and µ be two partitions such that the diagram of λ contains the diagram of µ, The skew partition of shape λ/µ can be defined as the set-theoretic difference λ − µ (λ is called the outer partition and µ the inner).
Figure 2. A tiling with 3-ribbons of the skew partition (8, 7, 6, 5, 1, 1)/(3, 3, 1) of spin 3 We will denote by P av k (λ/µ) the set of k-ribbon tilings of the skew shape λ/µ.The spin sp(P ) of a tiling P is the sum of the spins of its ribbons, and the cospin is the associated co-statistic into P av k (λ/µ), i.e: cosp(P ) = max{sp(U ), U ∈ P av k (λ/µ)} − sp(P ).Ribbon tableaux are labelled tilings verifying monotonicity conditions similar to these of Young tableaux.The spin of a k-ribbon tableau is the spin of the underlying tiling.A k-ribbon tableau of skew shape λ/µ is a tiling of the skew shape λ/µ by labelled k-ribbons such that the head of a ribbon labelled i must not be on the right of a ribbon labelled j > i and its tail must not be on the top of a ribbon labelled j ≥ i.The weight of a k-ribbon tableau is the vector ν such that ν i is the number of k-ribbons labelled i.

A generating algorithm
In this section, we describe a new algorithm for generating all the ribbon tableau in Tab k (λ/µ, δ) and computing their spin polynomials.The main basic idea is to apply recursively the algorithm of removing k-ribbon strips from a partition.

3.1.
A new coding for ribbon tableaux.In this subsection, we extend the coding of [13] which is not well adapted to ribbon tableaux with skew shape λ/µ and does not give immediate access to the shape of the tableau.If the partition λ is (λ 1 , . . ., λ n ), our coding is an n × λ 1 -array (A i,j ) defined as follow: there is the head of a ribbon labelled p in the cell (i, j), 3-A i,j = 0 otherwise.By construction, we can immediately read the shape of the corresponding ribbon tableau, and the length of the ribbons is obtained by dividing the number of non negative cells by the number of positive cells.This coding makes sense when k = 1 because we obtain the classical representation of a skew Young tableau (each ribbon is reduced to its head).
Example 2. The new coding of a 3-ribbon tableau of shape (8, 7, 6, 5, 1, 1) and weight (3, 3, 2, 1): The structure used in [13] was a matrix where the entry (i, j) is equal to k if there is the tail of a ribbon labelled i in the j-th column of the shape.We show that the main difficulty in carrying out this construction is that we cannot read the shape of the partition without reconstructing the entire ribbon tableau.Furthermore, this coding become non injective when we try to generalize it on ribbon tableaux of skew shape.With the previous example we would obtain the following matrix:     0 3 3 0 3 0 0 0 3 0 3 0 3 0 0 0 0 0 0 0 3 0 0 3 0 0 0 0 0 0 3 0 Example 3. The new coding of a 3-ribbon tableau of skew shape (8, 7, 6, 5, 1, 1)/(3, 3, 1) and weight (3, 2, 2, 1): Decoding a k-ribbon tableau from an array (A i,j ) is as follow: for each label p considered in decreasing order, we fix vertically by the head a ribbon labelled p in the cell (i, j) of the shape if A i,j = p, and we drive them to the frontier of the partition.
• Initialize: λ/µ ←− the shape of the tableau coded by M , -ν ←− the weight of the tableau.• For each label i in ν: fix ribbons labelled i by the head in each position corresponding to the cells labelled i in M , drive these ribbons on the frontier of λ, -λ ←− λ without previous ribbons labelled i.
• Output: The k-ribbon tableau corresponding to the array M .3.2.Adding and removing k-ribbon strip.In order to explain our generating algorithm, we begin with a general algorithm for adding or removing a k-ribbon strip from a partition (these two operators on partitions come from the representation theory of the quantum algebra U q ( sl n ), see [2] for more details).In a ribbon strip, the head of each ribbon lies in Θ ↑ and the tails in Θ ↓ .As a k-ribbon strip has a unique tiling by k-ribbons, it is completely defined by the positions of all the ribbons's heads and the outer partition or all the tails and the inner partition.For adding a k-ribbon strip Θ to a partition, we represent this strip by the integer vector P = (p 1 , . . ., p n ) with p i = k if Θ has a ribbon with tail in the i-th column of Θ ↓ .Similarly, for removing a k-ribbon strip Θ from a partition, the vector P is now defined by p i = −k if Θ has a ribbon with head in the i-th column of Θ ↑ .
Algorithm 2 (Algorithm for adding a k-ribbon strip to a partition).
• Initialize: In the previous algorithm, σ corresponds to a permutation which permits to sort the vector λ.Let defined the number of inversions of the permutation σ by the cardinality of the set {(i, j) such that i < j and σ(i) > σ(j)}.

3.3.
Generating algorithm and computation of the spin and cospin polynomials for ribbon tableaux of a given shape and weight.We will generalize the generating algorithm of [13] to the case of k-ribbon tableaux of skew shapes.A basic remark consists in the fact that the ribbons labelled i form a k ribbon strip Θ i of weight ν i .That's why we search recursively all the k-ribbon strip of weight ν i contained in the shape and removable from the outer partition and we fill an array with the positions of the head in Θ i ↑.As the algorithm 1 also returns the spin of the added/removed k-ribbon strip, by keeping the spin in each step of the construction we obtain finally the spin of each tableau.In other words this algorithm permits one to compute the spin and cospin polynomials without additional computation.
Algorithm 3 (Generating algorithm for ribbon tableaux and spin polynomials).
• Initialize: P = 0 and L ←− {(T, λ, 0)} where T is an array filled with -1 in cells corresponding to µ and 0 otherwise.• For each weight j from p down to 1, For each (T, λ T , sp T ) in L and each permutation C of the vector (0, . . ., 0 ) corresponding to a valid removed k-ribbon strip, fill in T the cells corresponding to the frontier of λ T and the non-zero coordinates of C, λ T ←− λ T without the k-ribbon strip corresponding to C, -sp T ←− sp T + the spin of the previous k-ribbon strip, • For each tableau T in L, P ←− P + q sp T .
• Output: -The list L of all the k-ribbon tableaux of skew shape λ/µ and weight ν, -P the spin polynomial of this set.
By studying the progress of this algorithm with huge set of ribbon tableaux we remark that at the bottom of the tree there are a lot of nodes, but in there is only few different shape for the remaining partition.For example the number of nodes for λ = (6,6,6,6,6,6) and ν = (3, 1, 1, 1, 1, 1, 1, 1, 1, 1) is the sequence 3, 12, 48, 198, 780, 2940, 10080, 31080, 81480 and finally 43680 but the number of different remaining shape are 3, 9, 16, 27, 33, 38, 33, 27, 16, 1.Our previous algorithm search, at step i, all the possibility to retire a k ribbon strip from the remaining partition, but in fact we need to test all the possibility only on the few remaining partitions.That's why a recursive implementation of the previous algorithm with a remember option seems to be the most efficient way to generate ribbon tableaux.

Definition 4 .
A skew tiling by k-ribbons Θ where the tail of each ribbon is not on top of an other ribbon is called a k-ribbon strip.The weight of Θ is the number of ribbons in the tiling.Let Θ ↑ (resp.Θ ↓ ) be the the horizontal strip made of the top cells (resp.the bottom cells) of the columns of Θ.