Round Robin Tournament Scheduling

Schedules - You must register to Post and Download => Requests => Topic started by: Kal on January 03, 2023, 01:07:53 PM

Title: Court Balanced, restricted games
Post by: Kal on January 03, 2023, 01:07:53 PM
Hello, 

I am trying to build a schedule generator for 4 - 20ish teams that has the following restrictions: 
- There are 4 unique games, Game A, Game B, Game C, Game D
- No team plays the same game twice
- No team plays the same team twice (except if there are 4 teams, then one pairing goes twice)
- There are 4 rounds

In my mind I was trying to build something like this for an example with 8 teams

              Game A             Game B          Game C           Game D
Round1     1v5                     2v6               3v7                4v8
Round2     3v8                     4v5               1v6                2v7
Round3     4v6                     1v7               2v8                3v5
Round4     2v7                     3v8               4v5                1v6

Every team plays every game, however Round4 Game C is a repeat of Teams 4v5. 
And I did this by hand... which is not ideal!  I'd like help using some of the good work on this forum to understand how I could automate this. 

Other notes: 
- I can make the teams even so I don't have to worry about byes, but if I don't have to that would be nice
- For larger numbers of teams like 12-20 teams, I can have more of the same games... for example: 

               Game A             Game B          Game C           Game D               Game A             Game B          Game C           Game D
Round1     1v5                     2v6               3v7                4v8                     9v16                 10v15             11v14             12v13
...

But I don't want any team to play the same game twice still even if they are in different 'rooms'

Any help is much appreciated!

Thanks, Kal
Title: Re: Court Balanced, restricted games
Post by: Ian Wakeling on January 04, 2023, 04:14:09 AM
I think for many of the schedules you could first fix the pairs of teams who should play each other, and do this in a way such that each team gets to play equally often (or as equally often as possible).  For example you could use my generator here (https://www.devenezia.com/round-robin/forum/index.php?topic=1132.0) and take some of the rounds.  Then in a second phase you could create an algorithm to allocate these match-ups to the 4 types of game - I am thinking of starting with a random allocation and then swap the pairs around to try to optimize the "no team plays the same game twice" criterion.  This will probably work quite well if the number of teams is not small.

For some numbers of teams you could use Latin squares.  For example two 4x4 orthogonal Latin squares will solve the 8 team problem.  See the order 4 squares here (https://en.wikipedia.org/wiki/Mutually_orthogonal_Latin_squares), then assign A to D to be teams 1 to 4 and alpha to delta to be teams 5 to 8.  Two such schedules, one on 1 to 8 and another on 9 to 16 would solve the 16 game problem, with two groups of 8 teams who never mix.

Hope that helps,  Ian.