Look for an algorithm or code if someone feels generous to do the following. I need to make input for several players. The number of players will always be a factor of 4. I want to group individual players into groups of 4 with the least number of repetitions. Initial placement is trivial:
1 2 3 4 Table 1
5 6 7 8 Table 2
9 10 11 12 Table 3
13 14 15 16 Table 4
17 18 19 20 Table 5
21 22 23 24 Table 6
Thus, players 1-4 "saw" each other once. Everyone plays their own game, and then the players are shuffled. In the next pass (and subsequent passes) I want to rearrange the players so that they have the least amount of overlap. Basically, I want the player to not see the repeated face for as long as possible, and as soon as this is no longer possible, I want to minimize it as little as possible.
It seems to me that this should be a relatively simple algorithm, but every approach that I ultimately take, feels that it weighs itself in favor of people who are being processed first ... and my opinion / mind tells me that there is an absolute right answer.
For clarity, no one is excluded; they are simply shuffled every time.
source
share