How to generate a round robin schedule with 4 players in each game

22 vues (au cours des 30 derniers jours)
Jacob Nelson
Jacob Nelson le 25 Mar 2020
I'm trying to come up with a schedule for me and my friends to have a Smash Bros league. Each game will have 4 players that receive more points the better they do. How would I go about generating a schedule in which all the teams play each other a similar amount of times? Our league is going to have 10 teams.

Réponses (1)

David Goodmanson
David Goodmanson le 28 Mar 2020
Modifié(e) : David Goodmanson le 29 Mar 2020
HI Jacob,
here's a standard way to create an n team round robin schedule (n even), teams plays each other once.
sched = [mod([reshape([2:n/2;n-1:-1:n/2+1],1,n-2) 1] +(-1:n-3)',n-1)+1, n*(ones(n-1,1))]
Each row in the resulting matrix represents a round, where the column numbers are paired up so that
2 9 3 8 4 7 5 6 1 10
means that team 2 plays team 9, team 3 plays team 8, etc. For an odd number of teams, 9 for example, do a 10 team schedule and anyone playing team 10 gets a bye.

Catégories

En savoir plus sur Strategy & Logic dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by