Sims filter

Sims-reduced generating set
Given a permutation group on $$\{ 1,2,3,\dots,n \}$$, a Sims-reduced generating set for it is a generating set with the property that given any $$i < j$$, there is at most one element in the generating set that sends $$i$$ to $$j$$ and fixes all elements less than $$i$$.

By definition, a Sims-reduced generating set has size at most $$\binom{n}{2}$$.

Better algorithms

 * Jerrum's filter is considered a better algorithm than the Sims filter because it is online, and it is guaranteed to produce a generating set of smaller size (a generating set produced by this filter is termed a Jerrum-reduced generating set). The Sims filter is faster to apply once; however, an algorithm that requires repeated use of the filtered set may prefer Jerrum's filter because the resulting set being small, algorithms that depend on the size of the resulting set are likely to work better.

Broad idea
The Sims filter works by constructing a partially filled $$n \times n$$ tableau capable of storing elements of the group, such that:


 * The tableau entry with row $$i$$ and column $$j$$ must fix all elements upto $$i-1$$ and must send $$i$$ to $$j$$.

The algorithms works in $$n$$ stages, filling in the $$i^{th}$$ row of the tableau at the $$i^{th}$$ stage.

Description of each iteration
Let $$A$$ denote the initial generating set.

Let $$B$$ denote the current generating set (initially set $$B$$ to be $$A$$). Then, at the $$i^{th}$$ stage, look at those elements of $$B$$ that are not already in the tableau. By the manner in which we construct things, it'll turn out that all the elements not already in the tableau must fix the first $$i-1$$ elements.

Now, as you linearly traverse over the elements of $$B$$ that are not already in the tableau, do the following:


 * If $$g$$ sends $$i$$ to $$j$$ and there is no element yet in the tableau's $$(i,j)^{th}$$ position, put $$g$$ there.
 * If $$g$$ sends $$i$$ to $$j$$ and there is already an element $$h$$ in the tableau's $$(i,j)^{th}$$ entry, replace $$g$$ by $$g^{-1}h$$. This new element will fix $$i$$ (keep the new element in $$B$$ bot do not put it in the tableau, it will be handled in the later rounds).
 * If $$g^{-1}h = e$$, remove it (note: this might well be the case even if the original generating set had distinct elements).

Clearly, at every step, the property that $$B$$ generates the group is preserved, hence, finally we will have a generating set of size $$n^2$$.

Analysis of running time
Let's analyze the time for each row. For each pass, there are as many as $$|B|$$ elements to scan, and for each scanned element, the time taken is roughly $$O(n)$$. Since $$|B| \le |A|$$ throughout, the total time taken for filling each row is bounded above by $$|A|n$$.

Thus, the total time across all rows is $$O(|A|n^2)$$.