1

I have a set $X$ that is acted on by $S_n$, and I've written some code that takes an input object $x\in X$ and finds the set $G\subseteq S_n$ of all permutations that fix $x$, essentially by brute force. The result is just a list of all the elements of $G$, and I would like to display the group in a more concise way, I guess as a minimum-size (or at least minimal) generating set for $G$. Is there an efficient way to obtain such a generating set?

The approach I can think of is: Pick elements of $G$ in some arbitrary order and maintain a set $H$ of all the permutations generated by the elements picked so far. Whenever we pick an element that is not already in $H$, add it to our generating set and grow $H$, and stop when $H=G$. But this feels slow (worse than linear-time in $|G|$, at least) and doesn't guarantee a minimal generating set (as we might pick $gh$ before $g$ and $h$, for example).

Shaun
  • 47,747
Karl
  • 12,752
  • After playing around with some examples in GAP, I'm realizing that a minimal generating set isn't always the best way to describe the structure of a permutation group, as this can obscure the independent factors. Apparently this is a deep topic, and I should think more about what I really want to do. – Karl Sep 24 '24 at 01:16

2 Answers2

3

The efficient way to do this is to compute the orbit of $x$ under $G$ at the same time as computing the stabilizer of $x$. The idea is that you apply every generator of $G$ to every element in the orbit, and with each application you either find a new element in the orbit, or you find a new generator of the stabilizer.

For full details, see Algorithm I.17, page 9 of Hulpke's Notes on Computational Group Theory.

Derek Holt
  • 96,726
  • Thanks, that whole document is very relevant to what I'm doing! It looks like the orbit-stabilizer algorithm produces a not-necessarily-minimal generating set for the stabilizer, and the notes on page 10 describe some ways to reduce it similar to what I mentioned in the question. I wonder if there's a way to take advantage of the permutation structure (like the other answer tried to do). – Karl Sep 25 '24 at 18:53
  • There are algorithms for finding smallest sized generating sets of finite groups, but that's really a separate question. See here for example. – Derek Holt Sep 25 '24 at 21:55
1

Here's a partial answer: every permutation in $S_n$ can be written uniquely as a product of disjoint cycles. Factoring runs in $O(n)$ time for any given permutation, so factoring all the permutations in $G$ takes $O(|G|n)$ time. From here, you could make a minimal/minimum-size generating set using some other algorithm, if one exists.

Otherwise, you can at least use this to improve the method you listed, using a kind of prime sieve: sort the permutations in $G$ by number of factors. Beginning with those with 1 factor, remove all permutations which contain it or its inverse as a factor. Then do the same with those with 2 factors (removing anything that contains both factors, or both inverses), and so on. This way, we ensure that the remaining generating set is minimal.

Edit: Actually, I think you can use this idea to make the entire algorithm more efficient. You say that you computed $G$ using brute force; but this is already very slow. Instead, you can build a generating set by first adding any cycles which stabilize $x$. Then add any pairs of cycles which stabilize $x$, such that neither of the cycles was added in the first step. Continue, making sure that no permutation we pick this way "divides" another (in the sense that one contains all the factors of the other), so that we get a minimal generating set. This should already be faster than calculating $G$ by brute force. If you actually need to operate using $G$ in some way, you can calculate the generated set; and if you just need to test whether some permutation $\tau$ is in $G$, then you can factor it and check it against the generating set.

Max Chien
  • 488
  • Thanks, this is exactly the kind of insight I was hoping for! If you're interested, my $x$ is a truth function, and in addition to finding the symmetry group, I want to "canonicalize" $x$ (map it to a canonical representative of its orbit under the action of $S_n$ - e.g. the one that minimizes the binary representation of the truth table) so that other data can be shared among objects that differ only by a relabeling. Maybe there's a way to combine these two operations. – Karl Sep 22 '24 at 23:40
  • I'm thinking about this more, and it seems like in order to get a minimal generating set we need to do more than just avoid products of already-included disjoint cycles. For example, ${(123),(234),(345)}$ is not minimal: any two non-disjoint 3-cycles generate the whole alternating group on the elements they touch, so $\langle(123),(345)\rangle=A_5$, which includes $(234)$. – Karl Sep 23 '24 at 05:46