I have 10 teams, and I would like to hold a activity to let their battle in the games.
- Teams competes in 6 rounds
- In each round 5 pairs competes
- Only unique pairs
Can I do this in Excel or R?
I have 10 teams, and I would like to hold a activity to let their battle in the games.
Can I do this in Excel or R?
What you need to apply is algorithm scheduling for round-robin tournament. Explanation of algorithm (elements rotation) is pretty easy and can be found here. Summarising, having 14 teams, we arrange them in matrix as follows.
Then algorithm does specific rotation, keeping first element in the same spot:
Here is reproduced solution done with R. Below example is for all combinations, but you can customise to your needs (n=10, r=13) or run for all rounds and pick-up random 6 rounds
library(dplyr)
n <- 14
teams <- 1:n
r <- 13
rounds <- list()
for( i in 1:r){
round <-
data.frame(
round = i,
team1 = teams[1:(n/2)],
team2 = rev(teams)[1:(n/2)])
rounds[[i]] <- round
teams <- c( teams[1], last(teams), head(teams[-1],-1) )
}
rr <- bind_rows(rounds)
head(rr)
# round team1 team2
# 1 1 1 14
# 2 1 2 13
# 3 1 3 12
# 4 1 4 11
# 5 1 5 10
# 6 1 6 9
Enjoy!