[GAP Forum] disjoint pairs

Lisette Brillemans lisette.brillemans at mensa.nl
Tue Nov 15 23:32:01 GMT 2011


Hello everybody!

Is there a function in GAP that returns all possible pairs of disjoint
combinations of a (subset of a) list?

So if I have for example a list [1,2,3,4,5] it should return:

[ [1,2],[3,4] ]
[ [1,2],[3,5] ]
[ [1,2],[4,5] ]
...
[ [1,2],[3] ]
[ [1,2],[4] ]
...
[ [1,2,3],[4,5] ]
[ [1,2,4],[3,5] ]
...
[ [1,2,3],[4] ]
[ [1,2,3],[5] ]
...
[ [1,2,3,4],[5] ]
[ [1,2,3,5],[4] ]
...
And all other possible pairs.


For any useful answer you will receive eternal thanks.


Lisette






More information about the Forum mailing list