I have a little problem I have some sets for example:
{1},{1, 2},{2},{2, 3},{3},{4},{4,5},{5}
and I need to get group or groups from these sets, which will contains elements from 1 to 5, so:
{1},{2},{3},{4},{5}
{1},{2,3},{4,5}
{1,2},{3},{4,5}
etc.
I need to get all complete combinations. How to do this effective? I was thinking about power set, but I guess, that it isn't best idea. Thanks in advance for your help.