General Question

How can I write a program to generate all partitions of a set?
I’m writing a program that does a whole bunch of set theory stuff to make my life easier, and I want it to generate all subsets of a list of elements. I’m looking for some kind of recursive solution…one that could ideally be contained in a single function or something. I know I’m like right on top of a solution, but for some reason I just can’t seem to carry it out.
For reference: http://en.wikipedia.org/wiki/Partition_of_a_set
Observing members:
0
Composing members:
0


4 Answers
Answer this question
This question is in the General Section. Responses must be helpful and on-topic.
Older »
What is a hob knocker?
« Newer
How does instinct work?
Have a question?
Ask Fluther!