Object type | |
Size $n$ of the integer/set | (max. 15) |
Number $m$ of parts/subsets | (between 1 and $n$) |
Output format | |
A set partition of a ground set is a partition of this set into nonempty subsets, where the ordering of the subsets is irrelevant. The ordering of elements in each subset is also irrelevant, and we use lexicographic ordering without loss of generality. For instance, all five set partitions of the ground set $\{1,2,3\}$ are $123,12|3,1|2|3,1|23,13|2$, where the boundaries between subsets are indicated by vertical bars, and subset brackets are omitted for simplicity.
The algorithms running on this website are part of Jörg Arndt's FXT library. Algorithms for generating integer partitions are described in Algorithms P and H in Knuth's book [Section 7.2.1.4, Knu11]. An algorithm for generating set partitions is decribed as Algorithm H in Knuth's book [Section 7.2.1.5, Knu11].