Find all possible partitions of n elements with k-sized subsets, where two elements share same set o
- by ypnos
I have n=32 elements that need to be partitioned into 8 sets, each set has to hold exactly k=4 elements.
I need to find all possible partitions with the constraint that each pair of elements only shares the same set once.
So if I start with [1 2 3 4] [5 6 7 8] [...], all consecutive partitions cannot hold e.g. [1 2 X X] or [X X 1 3]. sets are unordered.
Close to this problem are the stirling numbers of the second kind. However, they only solve the problem for arbitrarily sized sets.