Find all possible partitions of n elements with k-sized subsets, where two elements share same set o

Posted by ypnos on Stack Overflow See other posts from Stack Overflow or by ypnos
Published on 2010-06-18T13:59:48Z Indexed on 2010/06/18 14:03 UTC
Read the original article Hit count: 163

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about permutation

Related posts about combinatorics