Is there an algorithm for solving the following problem: let $g\_1,\ldots,g\_n$ be permutations in some (large) symmetric group, and $g$ be a permutation that is known to be in the subgroup generated by $g\_1,\ldots,g\_n$, can we write $g$ explicitly as a product of the $g\_i$'s?


My motivation is that I'm TAing an intro abstract algebra course, and would like to use the Rubik's cube to motivate a lot of things for my students, and would, in particular, like to show them an algorithm to solve it using group theory. (That is, I can write down what permutation of the cubes I have, and want to decompose it into basic rotations, which I then invert and do in the opposite order to get back to the solved state.) Though I'm interested in the more general case, not just for the Rubik(n) groups, if a solution works out.


Note: I don't really know what keywords to use for solving this problem, if someone can point me to the right search terms to google to get the results I'm looking for, I'll gladly close this.



Algorithm for decomposing permutations
Yes. The general rule of thumb is that groups described by permutations are computationally easy, groups described by generators and relations have computational problems that are generally undecidable, and matrix groups are somewhere in between.


There's a whole book "Permutation group algorithms" by Seress, Cambridge University Press, 2003.


The main technique for permutation groups is called the Schreier–Sims algorithm; there's a survey [here](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.90.3009&rep=rep1&type=pdf), for instance. The rough idea is to stabilize the permuted elements one at a time. As Mitch already said, though, this doesn't find the shortest word in the generators that produces any particular group element, which is a more difficult problem.


