Produce all unordered unique combinations of N-sized subsets of an m·N-sized set Say there is a set of m·N named elements. How to produce all the (unordered) combinations of N-sized subsets?
For example, m=2 and N=2, the elements are called A, B, C and D. There will be 3 combinations: AB+CD, AC+BD and AD+BC.
For m=2 and N=3 there will be 10 combinations. In general, it will be:
$$\frac{(mN)!}{(N!)^m\cdot m!}$$
(thanks to Ross Millikan)
How to approach creating an algorithm that produces / iterates over the whole set of combinations?
Knuth wrote a chapter on this, as part of the new volume 4 of his Art of Computer Programming.
The simplest algorithm uses the following recursion to generate all combinations of length $m$ of a set $x_1,\ldots,x_n$:

If $m = 0$ then output the empty set.
Otherwise, for each $m \leq i \leq n$, generate all combinations of length $m-1$ of $x_1,\ldots,x_{i-1}$, and add $x_i$ to all of them.