I am trying to write a method that will compute all permutations of a force set where order matters. I believe that they are called "arrangements." I mean:
{a} -> {{a}, {}} {a,b} -> {{a,b}, {b,a}, {a}, {b}, {}} {a,b,c} -> {{a,b,c}, {a,c,b}, {b,a,c}, {b,c,a}, {c,a,b}, {c,b,a}, {a,b}, {a,c}, {b,a}, {b,c}, {c,a}, {c,b}, {a}, {b}, {c}, {}}
etc .. My impression is that, given the set S, I have to generate every permutation of each subset of the power set S. Therefore, we first generate the power scheme, and then compare the permutation function to each set.
The problem is that it is very difficult - something like O (ÎŁn! / K!) With k = 0..n.
I am wondering if there are any existing algorithms that do such things very efficiently (possibly a parallel implementation). Or perhaps even if there is a parallel power transmission algorithm and there is a parallel permutation algorithm, I can combine the two.
Thoughts?