I need to produce the schedule of a sport-event.
There are 30 teams. Each team has to play 8 matches. This means that it is not possible for each team to compete again all other teams, but I need to avoid that two team compete more than once against each other.
My idea was to generate all possible matches (for 30 teams: (30*29)/2 = 435 matches
) and select from this list 120 matches (8 match for each team: 8 * 30 / 2 = 120 matches
).
This is where I'm having a hard time: how can I select these 120 matches? I tried some simple solutions (take first match of the list, then the last, and so on) but they don't seem to work with 30 teams. I also tried to generate all possible match combination and find which one is working but with 30 team, this is too much calculation time.
Is there an existing algorithm that I could implement?
UPDATE
What I need to produce is a simple schedule, without elimination. Each team play 8 matchs, and that's all. At the end of the day there won't be one winner.
Each team will have his schedule, and this schedule won't change wether they win or lose. The planning is done for the whole day and is immutable.
UPDATE 2
At first, I didn't want to put too many constraints to my question, but it seems that without any constraints (other than each team not competing more than once with each other), it's just a matter of random picking 8 matchs for each team.
So here is some more details :
During this sport event, there are 6 differents sports (soccer, handball, basketball, and so on). This means there are 6 simultaneous matchs. A new round is started every 15 minutes.
Each team will have to play 8 matches, and each sport at least once.
These 6 sports are taking place at three different places. This means that during the day, each team will have to move from one place to another. These moves should be reduced as much as possible.
A team cannot play two matches in a row.