'Finding the subset of a given index in lexicographic order
I am trying to generate all subsets of size k of sets of all integers between 1 and n inclusive (for n > 1) in lexicographic order. So, for n=4 and k=2, I want (1, 2), (1, 3), (1, 4), (2, 3)...
I have an algorithm to generate the next set in the sequence from the previous set. However, I would like to parallelize it for faster computation. Is there some method I could use to generate the set corresponding to a particular place in the order? I know I can split the series in half by starting with (2, 3, ..., k+1), but I would like to have a bit more flexibility to split it into at least 4 processes.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
