Skip to content

CyclePartition ​

The orbits, as a set partition of the positions.

CyclePartition(Permutation)The orbits, as a set partition of the positions.
Typed signatures
TypePackageApplies
(permutation) -> set_partitioncombinatoricsalways

Domain: Combinatorial maps

Details
  • Takes a Permutation and returns a SetPartition — a typed map, so a wrong carrier is a type error rather than a wrong answer.
  • Removed once for giving every position the same label. The cause was the laziness rule in flat.ts — folding over a list taken out of the accumulator instead of indexing a range. Written by index it is right first time.

Examples

Basic #

the one-line word 231231

live ↗
InCyclePartition(Permutation⁡([2,3,1]))\mathrm{CyclePartition}({\operatorname{Permutation}}([2, 3, 1]))OutSetPartition⁡([[1,2,3]]){\operatorname{SetPartition}}([[1, 2, 3]])
About
Examples1
CrosswalkFindStat