How Cup Manager works under the hood

For a long time, we have refined algorithms that are the basis for Cup Manager's many automatic functions.

Each new tournament has given us new insight into how complicated it is to design the perfect schedule.

Here you will get insight into some of our unique features that use the knowledge we have gathered over the years. 

Geographical division of teams

In order to make an automatic feature that you can actually rely on when it comes to handing out teams in groups (the same algorithm is actually used for playoff trees as well), it is important that you do not finish halfway and, for example, only take into account which clubs the teams come from. Such an algorithm leaves a lot of manual work to ensure that teams from the same city (or country in international tournaments) do not end up in the same group.

Therefore, in Cup Manager we take into account the following conflicts (a conflict is if two teams with the same characteristic below end up in the same group):

      1. Association
      2. Postcode
      3. City
      4. Municipality
      5. Sports district
      6. County
      7. Postcode area
      8. Land
      9. Landsregion
      10. Admin email address
      11. Jersey color
The conflicts are dealt with in order according to the list. It is e.g. worse if two hold from the same club end up in the same group than if two hold with the same shirt color do. The goal will be to minimize the number of conflicts in all groups.

There are three different features in Cup Manager that use the same conflicts to create the best schedule possible:

    • Group division of teams
    • Playoffs (there is the conflict that teams have progressed from the same group)
    • Match breakdown into struggling classes

Grouping of hold
In Cup Manager we have built a “conflict resolver” which is guaranteed to distribute 7537474588 9021044202454505160268323816 between groups in an optimal way. This means that Cup Manager always distributes hold to groups so that the number of conflicts is minimized. Together with the function that allows you to seed some hold before using the automatic function, one can therefore say that Cup Manager function to distribute 75374745889021044 202454505160268323816 is complete. The conflict resolver is actually one of the first things built for Cup Manager and has been included in all versions of Cup Manager since about 2008 (12 years at the time of this writing!).

Optimal playoffs

 

If you are interested in this in detail, you can read the next section which deals with endgame specifically, but already here we can reveal that the conflict resolver plays a central role.

Match breakdown into struggling classes

Since you don't have to rank teams in order of performance in struggling classes, amn doesn't have to let all teams in a group face each other either. It opens up to select certain matches from a large group where you avoid conflicts between the teams that play in the matches you select.

This may seem as simple a problem as handing out the law to groups, but the truth is that it is much more difficult. Unlike in the past, where it is possible to find a guaranteed optimal solution, here (at least with slightly larger groups) one has to settle for finding the best possible division. One can illustrate the difficulties by describing a sub-problem:

How many games do teams from the same club have to play against each other if they are in the same group of a certain size where all teams should play at least a certain number of matches?

For a 7-team group, the answer looks like this when you vary the number of teams from the same club (rows) and the number of matches per team (columns):

1 2 3 4 5 6

1

0

0

0

0

0

0

2

0

0

0

0

0

1

3

0

0

0

0

2

3

4

0

1

1

2

4

6

5

1

3

4

6

8

10

6

2

5

7

10

12

15

7

4

7

11

14

18

21

There are clear patterns in the table above, but the relationship is so complicated that we have had to simulate the results for different group sizes in advance in Cup Manager. This then helps the system to determine if it has found an optimal match division. 

Since there is no easy way to find the best matches, Cup Manager then tests itself just as a human would also do. The advantage for Cup Manager is that it goes very quickly and that Cup Manager can always keep track of that all teams have received the right number of matches. Cup Manager also handles all 11 conflicts from the list of conflicts. It's not easy to keep them in your head yourself! After all, it's this testing that can take a few minutes if you draw a fighting class in Cup Manager.  

Playoff tree

A good playoff tree should meet two requirements.

1. The higher the ranked team, the easier the path to the final
2. Teams that have faced each other earlier in the tournament shall meet as late in the playoffs as possible

The first requirement leads to the best ranked team facing the worst ranked team, the next best team will face the second worst team and so on. In reality, there are often several teams that have the same ranking (e.g. the 1s from all groups – with the exception mentioned in Rule 4).

 

 

Rule 2 is in many cases easy to follow. For example, if the 1st and 2nd in each group go to playoff A, you can place the 1 on one side of the playoff tree and the 2nd on the other side. It becomes more complicated if you have 3 teams from the same group in the same playoffs. Then you have to divide the playoff tree into 4 parts (at each Semi final) and then put a team in 3 of the four parts, with the result that two of the teams can meet already in the Semifinal if the bad luck/luck is there.

It is clear that you can end up in a very complicated situation here if you have several groups with odd numbers hold and maybe in the worst case even an uneven playoff tree. It is clear that it is not possible to solve all cases that may arise with ready-made templates. An algorithm is needed. Unfortunately, it can get even worse, because often you also want to follow a third requirement similar to requirement 2:

3. Teams that usually meet in series games or come from the same club should meet as late in the playoffs as possible.

This brings us to the limits of what is possible in practice. In Cup Manager, rule 3 is solved by checking that teams from the same club do not meet after creating groups and playoffs and placing the teams. Should you be unlucky, you will get help to move one of the teams to a new group to avoid the problem.

Finally, a playoff tree can be uneven (unless you use e.g. Best 3s). The fact that a playoff tree is uneven means that you have 14 teams and thus will have 1/8 finals, but only 6. This means that two of the teams must go straight to the 1/4 final. If you have an uneven playoff tree, there's one more rule:

4. In the case of uneven playoff trees, the teams that have played the most games shall have the preference to skip the opening round.

This means that if it is between the 1 in a 4-team group and the 1 in a 5-team group, the team in the 5-team group that has already played an extra match should skip the opening round of the playoffs.

Automatic scheduling

Scheduling is a problem that on the surface may seem simple, but is actually one of the hardest things there is for a computer to cope with. Even so, tournament administrators have always managed to set schedules without double meetings and with enough rest time. We took that into account when we built Cup Manager's algorithm for automatic scheduling. 

Just like a human would, Cup Manager places one match at a time in the schedule until all matches are placed. Should the bad luck occur, you simply remove the latest matches in the schedule and make a new attempt until all matches are placed. 

What, then, is the problem? A simple calculation example quickly answers that question. Let's assume we want to place 100 games on 10 different playing fields. If we have to try all 10 playing field for all 100 games when we set the schedule, we will test 100000000000000000 (100^10) different placements of matches. Even with all the world's supercomputers united, it would not have been possible to schedule with such a method. Then we haven't even taken into account the time the games are to be played. The obvious trick (which is easier said than done) is not to make mistakes when placing the matches. Suddenly all we have to do is test 1 schedule. Instead of correcting your errors afterwards, you have to be proactive and make sure not to make any (or at least very few) errors. 

Scheduling can then be divided into two issues that need to be resolved, or two questions to be answered during scheduling:

    1. Which match should I place next?
    2. What place and time should the match I have chosen be given?

If you answer "right" to the two questions throughout your scheduling, you are at the finish line! Unfortunately, the methods of answering those questions correctly are an entire field of science. The basis for Cup Manager's method of answering the questions comes from a thesis in computer science that you can download here. Using the method of ranking matches and placements described in that work, you will always get a balanced schedule with the same number of matches on each playing field.

To answer the questions, one must also take into account all the rules that exist for how the schedule for a tournament can look like. For example. rest times and which days a match should be played, but also more advanced rules that everyone should play at least one match on the main arena or artificial grass. Any rules you add will affect the answer to the two questions because it is with the help of the two questions that the system avoids breaking the rules.  

 Under the hood of Cup Manager's scheduler there is therefore an advanced scheduling engine that can schedule tournaments with several thousand matches, despite complicated rules. By taking into account all the rules you add to your schedule when the two questions are answered, Cup Manager can quickly schedule almost any schedule.  

We like to think about game schedules. Feel free to challenge us!

Cup Manager support

 Phone: 046-52580
E-mail:support@cupmanager.net 

Do you want a simpler life?

Contact us, or choose a time to book a demo of Cup Manager. We look forward to showing you our system.