Page 1 of 1

Round-robins the easy way

Posted: Fri Oct 10, 2014 2:45 pm
by Cody
I don't think this is documented anywhere, so I'm putting it up for anyone's reference.

It's trivial to generate round-robin schedules using Excel or another spreadsheet application (Google Spreadsheet, etc.). This serves the dual purpose of ensuring accuracy (as opposed to pulling from a random site) and making sure that teams are "balanced" in rooms.

I'll refer to this spreadsheet, which should be pretty self-explanatory, for the rest of this post.

The first steps are to generate a round-robin using the pivot-method documented on Wikipedia and other places. This is easy to understand on paper and is super easy to generate in a spreadsheet.

First, divide the number of teams by 2: this is the number of rooms you need. If you have an odd number of teams, add 1 before dividing by two; the additional team will be the "BYE". To do this quickly, you'll need 2 columns per room (each column being 1 team in the match). So columns should = number of teams, with each team assigned a number 1 to {number of teams} somewhere else.

In the second column, count down from the number of teams (this including the additional team for an odd number of teams) to 2; in our case, we simply do {last team} then {last team – 1} and drag down the rest of the way. Populate the first column with 1s commensurate with the rows you needed to get to 2. This is also the number of rounds you'll need.

Copy from the column w/ number of teams through 2; distribute across columns as shown in the "9 Teams" sheet (first: diagonally right; then: diagonally left). The last room should always have the last team twice in a row, around {half teams + 1} rounds into the schedule, or so.

Now chop off everything below 1 v 2 and fill in everything about the last team (going up: 2, 3, 4…{last team – 1}) as necessary. Every number should appear once in a row and, except for 1, appear once in a column (twice in a room); if this isn't the case, you've done something wrong.

This completes generation of the schedule; now comes room balancing.

For an odd number of teams (where the last team is a bye), getting a balanced schedule for rooms is easy: switch all the "x v 10" with "1 v y". Whoever was playing 10 for a given round now has the bye. This usually goes 1, {last team - 2}, {last team - 4}, .., {last team - 1}, {last team - 3}, ... or some such discernible pattern.

For an even number of teams, you want to find switches where switching "1 v x" into a room doesn't create situation where a team is in a non-first room more than twice. These occur in pairs.

For instance, the following usually holds:
– Switch the first and last "1 v x" (i.e. 1 v {last team} and 1 v 2) rounds with the room to the right, then (for more than 4 teams):
– Switch the middle "1 v x" (i.e. 1 v {last team / 2 + 1}) with the last room, then (for more than 6 teams):
– Switch the "1 v x" above and below the middle "1 v x" with the matches two rooms to the right, then (for more than 8 teams):
– Switch the "1 v x" above and below the first/last "1 v x" with the matches three rooms to the right, then (for more than 10 teams):
– Etc.

You can see this process on the '10 Team' sheet, with switches illustrated by bolding.

The first room should have two or so teams 3 times, and the last room will only see team 1 once, but this is pretty much as room-balanced as you can get.

Lastly, you can use the concatenate function to make a table that's easily pasted into Word. (=CONCATENATE(A1, " v ", B1), for instance).

These instructions are kind of long, but it's really quite easy once you've done it once or twice.

Re: Round-robins the easy way

Posted: Fri Oct 10, 2014 4:20 pm
by ryanrosenberg
What would be really awesome would be to create a set of public schedules for common field sizes where all a TD would have to do is change a list of teams and rooms to the actual teams and rooms and it would auto-populate a schedule. I'll try and make a small version of what I'm envisioning later tonight.

Re: Round-robins the easy way

Posted: Fri Oct 10, 2014 4:24 pm
by Cody
The Predictable Consequences wrote:What would be really awesome would be to create a set of public schedules for common field sizes where all a TD would have to do is change a list of teams and rooms to the actual teams and rooms and it would auto-populate a schedule. I'll try and make a small version of what I'm envisioning later tonight.
Matt Weiner is working on a similar project, at least with respect to schedule templates. You should have a chat with him.

I don't know how quickly such a project will be completed, however, and I found this interesting from a theoretical perspective, so I posted it as a quick reference.

Re: Round-robins the easy way

Posted: Fri Oct 10, 2014 4:51 pm
by Skepticism and Animal Feed
The Predictable Consequences wrote:What would be really awesome would be to create a set of public schedules for common field sizes where all a TD would have to do is change a list of teams and rooms to the actual teams and rooms and it would auto-populate a schedule. I'll try and make a small version of what I'm envisioning later tonight.
This definitely used to exist - I vaguely want to say some guy from the University of Michigan had these on his personal site?

Re: Round-robins the easy way

Posted: Fri Oct 10, 2014 5:09 pm
by Important Bird Area
The Predictable Consequences wrote:What would be really awesome would be to create a set of public schedules for common field sizes where all a TD would have to do is change a list of teams and rooms to the actual teams and rooms and it would auto-populate a schedule.
This is definitely a thing that exists.

Re: Round-robins the easy way

Posted: Fri Oct 10, 2014 6:35 pm
by jonpin
Just as a couple of notes on room-balancing:

* It's impossible to room-balance a single four-team round-robin. One team will be stationary for the three rounds (In case you're wondering: After round one, two teams switch rooms, leaving two teams that haven't moved. In round three, one of the stationary teams must travel to the other team's room.)
* Just from constantly using one and constantly being annoyed at people doing it wrong, I have a balanced 6-team round-robin memorized:
1-2 3-4 5-6
4-5 6-1 2-3
1-4 3-5 6-2
2-5 4-6 1-3
3-6 5-1 2-4
Each team visits two rooms twice and one room once.
* While I think it's preferable It is not always necessary to room balance. Particularly if coaches are reading, and you wish to avoid a coach reading for their own team, you might use a schedule where a team avoids one room. But it's lazy to use the schedule where Team 1 is in the same room all the time, and Team 2 is in the second room except for that one game.
* A number of TDs just order the teams in each group 1-N, which is perfectly fine. However, you might also choose to plan so that (if seeds hold) the last round is between two unbeaten teams (1 and 2 seeds); or if 2 teams are moving on from this stage to the next one, so that the 2nd and 3rd seeds meet in the last round.

Re: Round-robins the easy way

Posted: Fri Oct 10, 2014 6:45 pm
by coldstonesteveaustin
Personally, I'm just using Jonah's LaTeX schedules, and editing them to my needs. However, this requires both LaTeX software (free to download) and knowledge of the LaTeX language (which I don't have, I'm just learning as I go).

https://github.com/jonahgreenthal/qbschedule
http://latex-project.org/ftp.html

Re: Round-robins the easy way

Posted: Fri Oct 10, 2014 7:42 pm
by Cody
Hidehiro Anto wrote:Personally, I'm just using Jonah's LaTeX schedules, and editing them to my needs. However, this requires both LaTeX software (free to download) and knowledge of the LaTeX language (which I don't have, I'm just learning as I go).

https://github.com/jonahgreenthal/qbschedule
http://latex-project.org/ftp.html
I don't like these schedules for two reasons.

Primarily, and this is by far my biggest problem with them, I greatly dislike the way they look. Compare to the schedules for VCU Fall and PADAWAN, which I also did w/ LaTeX. I even prefer the look of the old Word schedules I made.

Secondarily, they don't cover nearly the formats that need to be covered. Compare the available schedules to this list I just generated. (there may be some mistakes as this was a quick effort). It's far easier to generate a schedule yourself and paste the table into Word (or convert to LaTeX using http://www.tablesgenerator.com if you're into that sort of thing).

Re: Round-robins the easy way

Posted: Fri Oct 10, 2014 7:52 pm
by Skepticism and Animal Feed
Also the vast majority of quizbowl will never learn or use LaTeX

Re: Round-robins the easy way

Posted: Fri Oct 10, 2014 9:24 pm
by cvdwightw
Cody wrote:Secondarily, they don't cover nearly the formats that need to be covered. Compare the available schedules to this list I just generated. (there may be some mistakes as this was a quick effort). It's far easier to generate a schedule yourself and paste the table into Word (or convert to LaTeX using http://www.tablesgenerator.com if you're into that sort of thing).
This spreadsheet I made a while ago covers basically every single one of those formats you listed except the ones requiring wild-card tiebreakers, plus suggested formats for 25-36 teams given 13 non-finals non-tiebreaker packets, plus schedules for as many numbers of teams between 37 and 48 as I could figure out.

It also has room-balanced schedules for the tricky numbers (6, 10, 16).

1) Find row with appropriate number of teams and non-finals/non-tiebreaker rounds in the "Look Here First!" sheet
2) Read the information in the row
3) Copy the appropriate schedules from the other sheets to your own Excel file

You can "disguise" seeds by having a 6-team bracket seeded 1-6 but their actual "numbers" are 4, 3, 6, 5, 1, 2, for instance.

I'll work on the "auto-populate" part.

Re: Round-robins the easy way

Posted: Sat Oct 11, 2014 7:35 pm
by Cody
cvdwightw wrote:This spreadsheet I made a while ago covers basically every single one of those formats you listed except the ones requiring wild-card tiebreakers, plus suggested formats for 25-36 teams given 13 non-finals non-tiebreaker packets, plus schedules for as many numbers of teams between 37 and 48 as I could figure out.
This is some hot stuff.

Re: Round-robins the easy way

Posted: Tue Oct 28, 2014 11:50 pm
by ryanrosenberg
I decided to extend the concept of "auto-filling schedule" a bit further, and made an Excel workbook for a 16 team tournament that's part schedule, part re-bracketer. Just enter the game scores in the schedule and the standings and playoff schedule will automatically update. While this won't replace other stat-keeping, it provides a quick and easy way to get printable prelim and playoff schedules. If this is something that would be useful for tournament hosts, it's not too much work to make them for other field sizes, and I could do some common ones (12, 18, 24, etc.) pretty easily.

edit: uploaded wrong file

Re: Round-robins the easy way

Posted: Wed Oct 29, 2014 10:38 am
by Joshua Rutsky
Ryan, can you explain a little about the Letters portion of this sheet? I think I get the idea, but I would like to be clear about it before trying it out.

Re: Round-robins the easy way

Posted: Wed Oct 29, 2014 11:23 am
by ryanrosenberg
"Numbers" and "Letters" are bracket names, and {Team One, Team Two,...} and {Team A, Team B,...} are the teams in the brackets. To fill out your schedule, edit the cells containing bracket names, teams, and rooms. For game results, enter them under the team name in the proper round. Below is an example of a schedule after Round 1 (the image may be a little cut off, click on it to see the full view).

Image

Re: Round-robins the easy way

Posted: Wed Aug 12, 2015 1:32 pm
by Cody
Having had occasion to use this again over the past weekend, I've compiled a round robin schedule for 3 to 12 teams onto the first sheet. The 9 team and some other sheets are left there as examples of how to generate your own. Same link.

Re: Round-robins the easy way

Posted: Fri Dec 11, 2015 1:08 pm
by Cody
I recently had a chance to look at creating better room balanced round robins and have created a new front sheet with a number of "perfectly" room balanced round robins. There's also a page with room balanced schedules for round robins of 13 thru 18 teams if for some reason you were running some kind of insane schedule. Same link. I've done a pretty thorough check on most of the 5-12 schedules but if you notice any errors, please let me know!

It's probably possible to improve "spread" (i.e. less occurrences of teams playing in a room 2x in a row), but I haven't looked into it at all yet.

As explained on the spreadsheet:
For a round robin of n teams:
  • n % 2 == 1: perfect room balance (every team plays 2 games in every room) (ex. 5, 7, 9, 11 teams)
  • n % 2 == 0 and n % 3 != 1: as-perfect-as-possible room balance (every team plays 1 game in 1 room and 2 games in every other room) (ex. 6, 8, 12 teams)
  • n % 2 == 0 and n % 3 == 1: room balance only possible using a balanced tournament design (BTD) or partition balanced tournament design (PBTD), which I haven't done yet (ex. 10 teams)
  • n == 4: room balance not possible, 1 team has to play 3 games in 1 room; everyone else plays 2 games in 1 room and 1 game in 1 room"
Some Python code documented with the theory (all from other sources, obviously) for those interested:

Code: Select all

def roundRobin(teamCount):
    """Input # of teams as an integer, n. Output is the schedule as a list of lists of lists: list of n - 1 rounds (n rounds for n % 2 == 1), each of which is a list of n / 2 pairings ([n + 1] / 2 pairings for n % 2 == 1), each of which has 1 element iff bye and 2 elements iff match."""
    if teamCount % 2 != 0:
        bye = True
        teamCount = teamCount + 1
        teams = list(range(teamCount))
    else:
        bye = False
        teams = list(range(1, teamCount+1))

    halfCount = teamCount // 2
    roundCount = teamCount - 1
    schedule = []
    
    for x in range(roundCount):
        round = []

        for y in range(halfCount):
            if teams[y] == 0:
                round.insert(0,[teams[teamCount-y-1]])
            elif teams[teamCount-y-1] == 0:
                round.insert(0,[teams[y]])
            else:
                """sorted() ensures that format is smaller no. v bigger no., useful when combined with alphabetized brackets later"""
                round.append(sorted([teams[y], teams[teamCount-y-1]]))

        if bye:
            """fix team 0 (bye), rotate all other by one position"""
            teams.insert(1, teams.pop())
        elif teamCount % 3 != 1:
            for y in range(halfCount-1):
                """fix team 1, rotate all others by n / 2 - 1 positions"""
                teams.insert(1, teams.pop())
            if x < halfCount-1:
                """for rounds 1 to n / 2 - 1, switch room 1 and room # matching round #"""
                round[0], round[x+1] = round[x+1], round[0]
            elif x < roundCount:
                """for rounds n / 2 to n - 1, switch room 1 and room # matching n - round #"""
                round[0], round[roundCount-x-1] = round[roundCount-x-1], round[0]
        else:
            #give up, use my heuristic
            teams.insert(1, teams.pop())
            if x == 0 or x == roundCount-1:
                round[0], round[1] = round[1], round[0]
            if teamCount > 4:
                if x == halfCount-1:
                    round[0], round[halfCount-1] = round[halfCount-1], round[0]
                elif x == halfCount-2 or x == halfCount:
                    round[0], round[2] = round[2], round[0]
                elif x == 1 or x == roundCount-2:
                    round[0], round[3] = round[3], round[0]
            if teamCount > 10:
                if x == halfCount-3 or x == halfCount+1:
                    round[0], round[4] = round[4], round[0]
                elif x == 2 or x == roundCount-3:
                    round[0], round[5] = round[5], round[0]
                elif x == halfCount-4 or x == halfCount+2:
                    round[0], round[6] = round[6], round[0]

        schedule.append(round)

    return schedule