I would like to get all the possible subsets of a given length, that lead up to the real set. So for the set [a,b,c] and subset sizes 1 & 2 I would like to calculate:
[[a,b],[c]] , [[b,c],[a]] , [[a,c],[b]]
I've been experimenting with code from Algorithm to calculate power set (all possible subsets) of a set in R , but that algorithm will generate all of the subsets, and not just those leading up to the set.
I'm trying to solve this problem for size ~30. I want to calculate the score of each combination of subsets and only keep the best ones, this way I hope memory is no difficulty. The programming language of choice is python.