- #1
cubemx
- 1
- 0
Hi,
I have a practical math problem that I can't solve by myself.
The problem is probably already solved by other people but I can't find it using Google.
If somebody knows a solution or is willing to try and solve it that would be awesome.
I need a algorithm to plan some kind of tournament.
This is the problem:
There are a total of p people, they are distributed over teams.
Ever round g different games are played, t teams play game A, t teams play game B etc. for all g games. (So the total number of teams is t*g.)
For instance:
g = 5, t=3 (so there a 15 teams)
....Round 1......Round 2.... Round 3 etc. etc.
Game A:...1 vs 2 vs 3….....4 vs 8 vs 15...…
Game B:...4 vs 5 vs 6...1 vs 7 vs 12...…
Game C:...7 vs 8 vs 9...2 vs 10 vs 13...…
Game D:...10 vs 11 vs 12...3 vs 6 vs 14...…
Game E:...13 vs 14 vs 15...5 vs 9 vs 11...…
Rule 1: Every team has to play every game at least once, but no more than strictly necessary to make all rules work.
Rule 2: Every team has to play against every other team,so team 1 has to play team 2,3,4...15 (team 2 has to play team all other teams etc. etc.). If team 1 already played team 12, they can only play each other again if it's strictly necessary to make the rules work. In the example above there was a match "1 vs 7 vs 12" so later on match "1 vs 12 vs 9" may only happen is there is no other option.
Rule 3: If a team has to play a game more than once, it's better if there is a pause between those games (so not in successive rounds).
Rule 4: If a team has to play a other team more than once, it's better if there is a pause between those games (so not in successive rounds).
Rule 5: If the people can't be distributed equally over the teams (for instance p=147 and there are 15 teams, three teams will be smaller), smaller teams shouldn't play each other if possible. So if team 13, 14 and 15 are smaller match "13 vs 14 vs 15" should be avoided if possible. (While match "13 vs 14 vs …" can't be avoided since team 13 has to play team 14 at least once.)
The rules are ordered according to importance, rule 1 is the most important.
The answer to this problem may be given in any form: group theory, graphs, algebra ect.
Buy I prefer some kind of pseudocode so I can easily make a Mathematica workbook or C++ application. Of course every little tip is very welcome, it doesn't have to be a complete solution!
Many thanks,
Eric
I have a practical math problem that I can't solve by myself.
The problem is probably already solved by other people but I can't find it using Google.
If somebody knows a solution or is willing to try and solve it that would be awesome.
I need a algorithm to plan some kind of tournament.
This is the problem:
There are a total of p people, they are distributed over teams.
Ever round g different games are played, t teams play game A, t teams play game B etc. for all g games. (So the total number of teams is t*g.)
For instance:
g = 5, t=3 (so there a 15 teams)
....Round 1......Round 2.... Round 3 etc. etc.
Game A:...1 vs 2 vs 3….....4 vs 8 vs 15...…
Game B:...4 vs 5 vs 6...1 vs 7 vs 12...…
Game C:...7 vs 8 vs 9...2 vs 10 vs 13...…
Game D:...10 vs 11 vs 12...3 vs 6 vs 14...…
Game E:...13 vs 14 vs 15...5 vs 9 vs 11...…
Rule 1: Every team has to play every game at least once, but no more than strictly necessary to make all rules work.
Rule 2: Every team has to play against every other team,so team 1 has to play team 2,3,4...15 (team 2 has to play team all other teams etc. etc.). If team 1 already played team 12, they can only play each other again if it's strictly necessary to make the rules work. In the example above there was a match "1 vs 7 vs 12" so later on match "1 vs 12 vs 9" may only happen is there is no other option.
Rule 3: If a team has to play a game more than once, it's better if there is a pause between those games (so not in successive rounds).
Rule 4: If a team has to play a other team more than once, it's better if there is a pause between those games (so not in successive rounds).
Rule 5: If the people can't be distributed equally over the teams (for instance p=147 and there are 15 teams, three teams will be smaller), smaller teams shouldn't play each other if possible. So if team 13, 14 and 15 are smaller match "13 vs 14 vs 15" should be avoided if possible. (While match "13 vs 14 vs …" can't be avoided since team 13 has to play team 14 at least once.)
The rules are ordered according to importance, rule 1 is the most important.
The answer to this problem may be given in any form: group theory, graphs, algebra ect.
Buy I prefer some kind of pseudocode so I can easily make a Mathematica workbook or C++ application. Of course every little tip is very welcome, it doesn't have to be a complete solution!
Many thanks,
Eric