1

I potentially want to write code for a 8-player/team round-robin tool that allows you to use any combination of schedule (e.g. select from various drop downs). The problem is I don't understand one complicated part.

I'll use an example to explain what I want to find:

Match Day 1

A vs B
C vs D
E vs F
G vs H

Simpler parts

  • The match days themselves can be in any order. A vs B, C vs D, E vs F, G vs H labels the starting pairings as a reference for the later match days.
  • The pairings within a match day can be any order: e.g. E vs F, A vs B, C vs D, G vs H.
  • The players/teams in the pairing can be written the other way around, e.g. A vs B could be B vs A.

Complicated part

If I however swapped 2 pairings between say match day 1 and another match day, what are the ways that can be done?

If you have A vs B, C vs D, E vs F, G vs H as the first match day in 1 combination, you can swap out E vs F, G vs H for E vs G, F vs H or for E vs H, F vs G (2 additional combinations). Since this is a round robin of 8, there's 7 match days, so you could swap (2 ways) between 2, 4 or 6 match days, or swap (3 ways) between 3 or 6 match days. What is the best way to list all these combinations down?

  • That's not complicated – it's incomprehensible. What do you mean? – Gerry Myerson Mar 23 '20 at 12:18
  • If you have A vs B, C vs D, E vs F, G vs H as the first match day in 1 combination, you can swap out E vs F, G vs H for E vs G, F vs H or for E vs H, F vs G (2 additional combinations). Since this is a round robin of 8, there's 7 match days, so you could swap (2 ways) between 2, 4 or 6 match days, or swap (3 ways) between 3 or 6 match days. What is the best way to list all these combinations down?

    I'll add this to the OP.

    – Jack Ralls Mar 23 '20 at 13:40
  • Are you just trying to list all the ways you can play the tournament, so list the four matches on each day of seven? You talk of listing the possibilities if you swap certain things. Is it important that certain ways of playing are related by a small number of swaps? – Ross Millikan Mar 23 '20 at 14:04
  • The swapping is just to illustrate that there are lots of combinations that are incompatible with each other. If I used one website to output the 7 day schedule, it could be different to another. If I tried to match the ordering that I mentioned under simpler parts, there'd still be a difference. I want to list all these ways, but I don't know how to organize this well and know that I am counting actual differences. – Jack Ralls Mar 23 '20 at 14:41
  • If you just want to run one eight-player round-robin tournament, see https://en.wikipedia.org/wiki/Round-robin_tournament#Scheduling_algorithm If you want to know how many different eight-player round-robin tournaments there are, then https://math.stackexchange.com/questions/284416/how-many-possible-arrangements-for-a-round-robin-tournament and the links there will get you started. If you want a program that prints them all, that's really a coding problem, not a math problem, but still the links at that earlier m.se question may help. If it's something else, (continued) – Gerry Myerson Mar 25 '20 at 00:11
  • ... then explain what you want here. If you want to be sure I see a comment from you, you have to put @Gerry in it. – Gerry Myerson Mar 25 '20 at 00:12
  • Any thoughts on my comments, Jack? – Gerry Myerson Mar 26 '20 at 11:22
  • Thank you very much @GerryMyerson, I'm having a bit of trouble understanding, would 6240 (1-factorization for K₈) × 7! (match days) × 4! (pairings within a match day) × 2! (players/teams written in obverse/reverse within the pairing) give the total number of schedule permutations for a round-robin of 8? – Jack Ralls Mar 26 '20 at 17:36
  • I think that's right, except for the last bit. Each pairing can be written in reverse, and there are $28$ pairings in each schedule, so I think you need to multiply, not by $2!$, but by $(2!)^{28}$. – Gerry Myerson Mar 26 '20 at 22:42
  • 1
    @GerryMyerson thanks again, I didn't realize that. It was like I was only considering between making them all reverse or not. But indeed you can toggle all 28 pairings without any depending on each other. I will read more about 1-factorization now. – Jack Ralls Mar 27 '20 at 10:01

0 Answers0