2

I'm looking for a function similar to the one in the question below, but for the more general problem of set partitions without restricting the set size.

NextKSizePartition, or how to partition a set into subsets of size $k$ but incrementally

Combinatorica provides the function SetPartitions which returns all the set partitions of the given set. The output size corresponds with the bell numbers which grow quite quickly. I would like to iterate over all set partitions without generating the entire list. Does there already exist a function with this capacity?

David
  • 159
  • 6

0 Answers0