This question might seem very much like the linked one below but it differs in a very special way; Mr.Wizard suggested I start a new post:
Partition a set into subsets of size $k$
What I want is to generate all the partitions of a set into subsets of size $k$ but incrementally, that is, one by one, so that I can generate one, process the partition in some way, and then continue with the next one in some loop. Ideally, the program will give the partitions in some sorted way, and if started with some partition, it would go on to give the next one, and then the next one, and so on. One could think of this as the NextKSizePartition function which given a partition finds the next one, in some kind of order ... if the program were to return them in lexicographic order, then that would be even better. Of course, the set of elements has to be a multiple of $k$. Note that a function like this is not available in Combinatorica.
The rationale for wanting this is that if you want, say, the partitions of the set of numbers from 1 to 16 into sets of size 2, you already get over a million of them ... if you want 18, over 10 million, and son on. So very soon you get into numbers that don’t fit in memory, but can still be processed sequentially. In what I look for, the higher up I check for certain properties, the better, even if it is just an increment in the set size by 2 or 4. In the world of combinatorial and graph theoretical conjectures, there is a fine threshold of when something might fail and when it is likely to stand ...
I hope the request is clear
k
. That's is apparently not what you want. I delete my post. $\endgroup$Subsets[Range@100, {4}, {10^6}]
(giving the 10^6th subset of size 4 of the range [1,100]) - it pulls a given subset in a few hundred-thousandths of a second on a laptop... $\endgroup$