|
-
October 8th, 2008, 10:17 AM
#4
Re: Algorithm or not
Looking at your table again, I just realized that the solution is much more trivial (and that my initial solution is wrong )
Code:
Participant R1 R2 R3 R4 R5
P1 P2 P3 P4 P5 P6
P2 P3 P4 P5 P6 P1
P3 P4 P5 P6 P1 P2
P4 P5 P6 P1 P2 P3
P5 P6 P1 P2 P3 P4
P6 P1 P2 P3 P4 P5
Notice that if you take the sequence P1-P6 and rotate it one time each round, you'll get the matching you need for each of the participant.
In round one, the sequence P1 - P6 is rotated once to the left - the sequence goes:
P2-P3-P4-P5-P6-P1.
In round two, the sequence P1 - P6 is rotated twice to the left - the sequence goes:
P3-P4-P5-P6-P2-P1.
And so on.
I think it's quite easy to fill a "magic square" matrix like this.
Only seeing your output made realize how easy it really is ....
Regards,
Zachm
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|