creating a Free-For-All (1v1v1v1) schedule for 20 teams over 13 weeks

129 Views Asked by At

I have a project I am working on for a fantasy football league and have hit a snag that potentially could be solved with math and I'm hopeful I might find some assistance here, as I'm lost on where to go from here.

Here is my goal: Create a season schedule for 20 teams over 13 weeks where each team plays every other team 2 times, except each team will end up needing to play ONE other team 3 times, over the course of the season.

That's cake but the monkey wrench is that instead of head-to-head games each week (like in football and the majority of team sports), each team will essentially play 3 other teams each week, in groupings of 4 (so A, B, C, and D will each play each other, as will E, F, G, and H, and so on). So for the whole league there would be 5 unique groupings consisting of 4 teams each, every week.

Also, I want the schedule to never repeat a unique grouping. For example, a group consisting of team A, B, C and D would never repeat in a season but A, B, C and E would be okay.

I couldn't figure out a math way to solve the issue of getting a schedule that would complete these goals so I started down the path of creating a randomized schedule that has some teams playing each other up to 6 times and others none, just to get some data in front of me. I then massaged the data team by team and week by week to get the conditions met. I got about a quarter of the way through and have stalled out because it is too much musical chairs going on and every change to accommodate one team creates problems for two or three teams, so it doesn't seem like a good solution, or at least would take me a month to manually untangle all the wires.

Does anyone have any suggestions on a method to sort this problem out?

Here is the Google Spreadsheet I've been working off of to keep track of the manual edits I'm making. It is very low-tech with no behind the scenes macros or such so I think everyone here should be able to figure out what's happening, but happy to answer any questions

https://docs.google.com/spreadsheets/d/1jgIrQK_SbwVmMShwouFUy4RVRD0DkkEik9KYVUNrlJ8/edit?usp=sharing

Any advice or leads would be greatly appreciated.

Cheers!