in reply to Permutation of groups
The first is to use binomial rankings as seen here. This approach is a bit cumbersome because it gives unique ranks for teams of a specific size only. This is fine as long as you pay attention to the size and adjust accordingly. For instance, you would need to specify the size of the team and the rank to retrieve the group:
A B C D Size 4 = ABCD rank 1 Size 3 = ABC ABD ACD BCD rank 1 .. 4 Size 2 = AB AC AD BC BD CD rank 1 .. 6 Size 1 = A B C D rank 1 .. 4
The second is to look at all the possible combinations and count in binary. This is the technique I used here (C code). Basically, the idea is to assign each element in the complete list a value and then for each combination to add them up. For instance:
It should be pretty clear how to convert 13 back into powers of 2 and then get the original set back.A = 2^0 = 1 B = 2^1 = 2 C = 2^2 = 4 D = 2^3 = 8 A C D = 1 + 4 + 8 = 13
If you need fully working code let me know.
Cheers - L~R
|
|---|