The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

CM::Group::Sym - An implementation of the finite symmetric group S_n

VERSION

version 0.05

DESCRIPTION

CM::Group::Sym is an implementation of the finite Symmetric Group S_n

SYNOPSIS

    use CM::Group::Sym;
    my $G = CM::Group::Sym->new({$n=>3});
    $G->compute();

This way you will generate S_3 with all it's 6 elements which are permutations. Say you want to print the operation table(Cayley table).

    print $G

    6 5 4 3 2 1
    3 4 5 6 1 2
    2 1 6 5 4 3
    5 6 1 2 3 4
    4 3 2 1 6 5
    1 2 3 4 5 6

Note that those are only labels for the elements as printing the whole permutations would render the table useless since they wouldn't fit.

So if you want to see the meaning of the numbers(the permutations behind them) you can use str_perm()

    print $G->str_perm;

    1 -> 3 2 1
    2 -> 2 3 1
    3 -> 2 1 3
    4 -> 3 1 2
    5 -> 1 3 2
    6 -> 1 2 3

compute()

Computes the operation table.

draw_cayley_digraph($path)

This method will draw the cayley digraph of the group to png to the given $path. You can read the graph as follows. An edge from X to Y with a label Z on it that means X * Z = Y where X,Y,Z are labels of permutations. Beyond n=3 it's very hard to understand anything in the diagram(because S_n is a big group in general).

NOTES

Internally the permutations are stored in arrayref of arrayrefs and each cell contains a CM::Permutation object.

TODO

  • cache_perms to store permutations instead of storing them inside operation_table and 2 methods label2perm and perm2label

  • writing code for calculating the subgroup lattice of a group S_n and representing it in a nice way

  • hardcoding well-known groups , their isomorphic subgroup of S_n and using that before an exhaustive check in the previous point

  • making a routine that will check if a subgroup's operation table is equal to some particular subgroup of some S_n(since order of S_n is n! above n>5 there isn't much hope for this) and if so identify them as being isomorphic.

AUTHOR

Stefan Petrea, <stefan.petrea at gmail.com>