RobinHankin / permutations

https://robinhankin.github.io/permutations/
5 stars 3 forks source link

order of cycles in a permutation (print method) #39

Closed RobinHankin closed 7 months ago

RobinHankin commented 1 year ago
> rgivenshape(20,2:3)
 [1] (15)(234) (12)(354) (134)(25) (132)(45)
 [5] (143)(25) (145)(23) (135)(24) (152)(34)
 [9] (125)(34) (13)(245) (13)(245) (12)(354)
[13] (13)(254) (145)(23) (13)(245) (145)(23)
[17] (12)(345) (12)(354) (12)(345) (12)(354)
> 

Above, it would be good to make it obvious that all the elements have the same shape, namely 23: each one comprises a 2-cycle and a 3-cycle. But this is not obvious, because the order given by nicify_cyclist() tries to put the 1 first. It might be possible to force the print method to put the cycles in increasing (or decreasing) order of size.