How Cup Manager works under the hood
We've spent years refining the algorithms behind Cup Manager's many automatic features.
Every new tournament has taught us something new about how complicated it is to design the perfect schedule.
Here's a look at some of our unique features, built on the knowledge we've gathered over the years.
Geographic grouping of teams
To build an automatic function you can actually rely on for splitting teams into groups (the same algorithm is also used for playoff brackets), you can't stop halfway and only consider which club each team belongs to. That kind of algorithm leaves a lot of manual work behind, since teams from the same city (or country, in international tournaments) can still end up in the same group.
That's why Cup Manager takes the following conflicts into account (a conflict is when two teams sharing one of these properties end up in the same group):
- Club
- Postal code
- City
- Municipality
- Sports district
- County
- Postal code area
- Country
- Country region
- Admin email address
- Jersey color
Conflicts are handled in the order of the list above. It's worse, for example, if two teams from the same club end up in the same group than if two teams simply share a jersey color. The goal is to minimize the total number of conflicts across all groups.
Cup Manager has three different features that use these same conflicts to build the best possible schedule:
- Grouping teams
- Playoffs (where an extra conflict is added: teams that advanced from the same group)
- Match assignment in non-ranked classes
Grouping teams
Cup Manager has a built-in "conflict solver" that's guaranteed to split teams between groups in an optimal way. That means Cup Manager always distributes teams so the number of conflicts is minimized. Combined with the option to seed certain teams before running the automatic function, this makes Cup Manager's team-grouping feature complete. The conflict solver is actually one of the first things ever built for Cup Manager, and it's been part of every version since around 2008 (12 years, at the time of writing!).
Optimal playoff brackets
If you want the details, read the next section, which covers playoffs specifically — but we can already reveal that the conflict solver plays a central role there too.
Match assignment in non-ranked classes
Since teams in non-ranked classes don't need to be ranked by result, not every team in a group has to play every other team. That opens up the possibility of selecting a subset of matches from a large group while still avoiding conflicts between the teams playing in the matches chosen.
This can look like just as simple a problem as splitting teams into groups, but the truth is it's far harder. Unlike the earlier case, where a guaranteed optimal solution can always be found, here — at least for somewhat larger groups — you have to settle for the best split you can find. One way to illustrate the difficulty is to describe a sub-problem:
How many matches must teams from the same club play against each other if they're in a group of a certain size, where every team must play at least a certain number of matches?
For a 7-team group, here's what the answer looks like as 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 complicated enough that we've had to simulate the results for different group sizes in advance inside Cup Manager. That precomputed data then helps the system determine whether it has found an optimal match assignment.
Since there's no simple way to find the best matches, Cup Manager tries its way forward — much like a human would. The advantage Cup Manager has is speed, and the ability to constantly keep track of whether every team has the right number of matches. Cup Manager also handles all 11 conflicts from the list above, which isn't easy to keep in your head on your own! This trial-and-error process is what can take a few minutes when you draw a non-ranked class in Cup Manager.
Playoff brackets
A good playoff bracket needs to satisfy two requirements.
1. The higher a team is ranked, the easier its path to the final should be
2. Teams that have already met earlier in the tournament should meet as late as possible in the playoffs
The first requirement means the top-ranked team should face the lowest-ranked team, the second-best team should face the second-lowest, and so on. In reality, several teams often share the same ranking (for example, all the group winners — with the exception noted in rule 4).

Rule 2 is often easy to follow. If, for example, the 1st and 2nd place teams from every group advance to playoff bracket A, you can place all the 1st-place teams on one side of the bracket and the 2nd-place teams on the other. It gets more complicated when three teams from the same group land in the same playoff bracket. Then the bracket has to be split into 4 parts (at each semifinal), with one team placed in 3 of the 4 parts — meaning two of those teams could end up meeting as early as the semifinal, if luck isn't on their side.
It's easy to see how this can turn into a genuinely tricky situation if you have several groups with an odd number of teams, and possibly even an uneven playoff bracket on top of that. It's clear that not every case can be solved with ready-made templates — you need an algorithm. Unfortunately, it can get even trickier, because there's often a third requirement to follow, similar to requirement 2:
3. Teams that regularly meet in league play, or that come from the same club, should meet as late as possible in the playoffs.
This is where things reach the limit of what's practically possible. In Cup Manager, rule 3 is handled by checking, after groups and playoffs have been created and teams placed, whether any teams from the same club are set to meet. If that happens, the system helps you move one of the teams to a new group to avoid the problem.
Finally, a playoff bracket can be uneven (unless you use a feature like Best 3rd-Place Teams). An uneven bracket means, for example, that you have 14 teams and would therefore need a round of 16, but only have 6 matches worth of teams for it. That means two of the teams have to go straight through to the quarterfinal. If you have an uneven bracket, there's one more rule:
4. In an uneven playoff bracket, the teams that have played the most matches should get priority to skip the opening round.
That means if it comes down to a choice between the 1st-place team in a 4-team group and the 1st-place team in a 5-team group, the team from the 5-team group — having already played one extra match — should be the one to skip the opening round of the playoffs.
Automatic scheduling
Scheduling is a problem that can look simple on the surface, but is actually one of the hardest things for a computer to handle. Even so, tournament organizers have managed to build match schedules without double-bookings and with enough rest time between games for as long as tournaments have existed. That's what inspired us when we built Cup Manager's automatic scheduling algorithm.
Just like a human would, Cup Manager places one match at a time into the schedule until every match has a slot. If it hits a dead end, it simply removes the most recently placed matches and tries again, until everything fits.
So what's the actual problem? A simple calculation answers that quickly. Say we want to schedule 100 matches across 10 different fields. If we had to try all 10 fields for all 100 matches while building the schedule, we'd be testing 100,000,000,000,000,000,000 (100^10) different match placements. Not even every supercomputer on Earth combined could schedule a tournament that way — and that's before even factoring in kickoff times. The obvious trick (easier said than done) is to avoid making mistakes when placing matches in the first place. Suddenly you only need to test 1 schedule. Instead of correcting errors after the fact, you have to be forward-looking and make sure you make no mistakes at all — or at least very few.
Scheduling can then be broken down into two problems that need solving, or two questions to answer at every step of building the schedule:
- Which match should I place next?
- What field and time should the chosen match get?
If you answer those two questions "correctly" throughout the entire scheduling process, you're done! Unfortunately, the methods for answering them correctly make up an entire field of science. The foundation of Cup Manager's approach comes from a computer science master's thesis you can download here. Using the method described there for ranking matches and time slots, you'll always end up with a balanced schedule with an equal number of matches on every field.
Answering those questions also has to account for every rule governing what a tournament's schedule is allowed to look like — things like rest periods and which days a match can be played, but also more advanced rules like requiring every team to play at least one match on the main field or on artificial turf. Every rule you add affects the answers to those two questions, since it's through those two questions that the system avoids breaking any of the rules.
Under the hood of Cup Manager's scheduler is therefore an advanced scheduling engine capable of handling tournaments with several thousand matches, even with complicated rules in play. By taking every rule you've added into account when answering the two key questions, Cup Manager can schedule almost any tournament quickly.
We love thinking about schedules. Feel free to challenge us!
Cup Manager support
Telefon: 046-52580E-post: support@cupmanager.net
Ready for an easier life?
Get in touch with us, or pick a time to book a demo of Cup Manager. We look forward to showing you our system.
Pick a time for a demo