Petrea Corneliu Ştefan > CM-Permutation-0.94 > CM::Permutation



Annotate this POD


Open  0
View/Report Bugs
Module Version: 0.94   Source  


Permutations can be viewed as braids but braids are much more general. (if you consider a permutation and apply it to itself it returns to the identical permutation, if you have a braid that's a transposition and apply it to itself you get a double-twist, one more time you get a triple twist and so forth this continues indefinitely).


CM::Permutation - Module for manipulating permutations


version 0.94


The module was written for carrying out permutation operations. This module treats permutations as bijections on finite sets. The module is not written for generating permutations or counting them(to that end you can use Algorithm::Permute or Math::Counting)

At the moment the following are implemented(any feature that is currently listed as implemented has tests proving it):

Permutations in relation to braids ^

There's also a draw() method so if you want to visualize permutations as braids you can.

For example permutation (9,6,4,8,5,3,7,10,1,2) can be representated as a braid like this:

and permutation (6,10,2,9,6,1,7,8,4,5) is like this

Then you can also compute a*b

And also a*b*a^-1

And also [a,b] which is a*b*a^-1*b^-1

Viewing cycles ^

Cycles have the following shape (except they can have some fixed points inside them)


or like this

Some differences between brides and permutations ^

However, braids are more general than permutations. The twists that are the analog of transpositions(in symmetric groups) for braids have infinite order since you can twist 2 strands as many times you want. Another difference is that for a transposition x we have x = x^-1, but with braids that isn't true since you have the first strand above the second for x and for x^-1 you have the second over the first so you can un-twist the braid using x^-1.

Transpositions and cycles ^

To understand better how transpositions and cycles interact let's take a look at the following diagram which shows the effects of multiplying a permutation formed of two cycles with a transposition containing members from each of the cycles:

Let's have an example of this with the cycles [1,2,3,4] , [5,6,7,8] and the transposition [3,7] :


    $ decomp(cycle(1,2,3,4)*cycle(5,6,7,8))
    $ decomp(cycle(1,2,3,4)*cycle(5,6,7,8)*cycle(3,7))


Thanks for the colour ramp routine goes to BrowserUk @perlmonks


Stefan Petrea, <stefan.petrea at>


Algorithm::Permute or Math::Counting



syntax highlighting: