There are four different types of FIDE Swiss pairing algorithms: FIDE Dutch (most popular and used in tournaments today), FIDE Dubov (what we will cover in this article), FIDE Burstein, and FIDE Lim. Most of the articles written by FIDE are pretty unclear, a bit confusing, and do not cover the actual logic of the algorithm as clearly (or give any examples); so this article's goal is to demestify the FIDE Dubov Swiss system so anybody can understand how to do pairings with this easily.
The Dubov System is a special system that primarily focuses on trying to give players due colors as much as possible. It is primarily used in tournaments with a large number of players and many rounds. Unlike the Dutch system, which focuses purely on score groups, Dubov aims to equalize the "Average Rating of Opponents" (ARO) for every player. It's complex, math-heavy, and beautiful.
Note that this article describes the pairing logic as written in the official FIDE Handbook.
Built on CPPDubovSystem
This isn't just theory. I built the open-source framework CPPDubovSystem to handle these calculations. I even stress-tested the results against FIDE's own SPP standards to ensure tournament-grade accuracy.
Key Terminology
ARO (Average Rating of Opponents)
The core metric of Dubov. The goal is to pair players such that everyone's ARO remains as close as possible. Calculating ARO is generally pretty easy: take the ratings of all the opponents the player has played, and calculate the average value of it. If the player has yet to play anyone (this can happen if, for instance, round 2 is being paired and the player got a BYE in round 1) their ARO is 0.
Due Color
The color a player 'should' have in the next round to maintain balance. A player's color preference is the number of games they played as White - the number of games they played as Black. If the number is 1 (i.e. the player played more games as White) they have a **strong** color preference for playing as Black (likewise, if it is -1, they have a strong color preference for playing as White). If this number is 2 (or -2), the player has an **absolute** color preference (meaning that they MUST get that due color). If the computed value is 0, they don't have a color preference.
Absolute Criteria
Rules that cannot be broken under any circumstance. These are: a player cannot play the same opponent twice, a player should not play the same color three times in a row (basically don't violate absolute color preference), and a player who has got a BYE before (or scored a forfeit win) should not get a BYE again.
Floaters
Players moved out of their score group to find a legal pairing. In Dubov, this impacts ARO calculation heavily. Unlike the FIDE Dutch system, the FIDE Dubov system only has one type of floater, 'Upfloaters'. Upfloaters are anyone who played someone who has a higher score than them. For instance, if Bob (who has 1.0 points) plays Joe (who has 2.0 points), Bob is the upfloater.
Max-Upfloaters
Players who should not upfloat a certain number of times. This number varies depending on the number of rounds a tournament has. The Max-Upfloaters can be computed with the following formula: Max-Upfloaters = 2 + [total_rounds_in_tournament / 5]. Note that **[total_rounds_in_tournament / 5]** means we divide the total number of rounds in the tournament by 5 and take the floor of it (i.e. round down).
Score Groups
A score group is defined to be a group of players who have the exact same score.
Rating
All players in the FIDE Dubov system MUST have a rating!
Pairing Number
Special numbers assigned to players at the beginning of the tournament. Players with a higher rating usually have a higher (or smaller) pairing number. For example, if we have the players: Player 1 (2200), Player 2 (2400), Player 3 (1900), and Player 4 (2000) we would give the pairing numbers as follows: Player 2 has pairing number '1', Player 1 has pairing number '2', Player 4 has pairing number '3' and Player 3 has pairing number '4'.
The Pairing Algorithm
1. Round 1 Pairings
Round 1 pairings in the Dubov system are identical to those in the FIDE Dutch (and other) Swiss systems -- there is nothing special about it here.
2. Calculating ARO (Subsequent Rounds)
Before pairing, calculate the current ARO for every player. You should also compute the due colors and preferences ahead of time. After you have done that, divide all the players into their score groups (see key terminology) and sort by their pairing number (those with a smaller pairing number should be closer to the top of the list). Below is an example of how we divide such players.
Assume that the following players have the scores: Player 2 (pairing number = 1, points = 1.0), Player 1 (pairing number = 2, points = 1.0), Player 4 (pairing number = 3, points = 0.0), Player 3 (pairing number = 4, points = 0.0). We would divide them up as follows: the 1.0 score group contains (properly sorted): Player 2, Player 1. The 0.0 score group contains (also properly sorted): Player 4 and Player 3.
3. Pair the Top Group
Begin by pairing the score group with the largest amount of points. Note that the logic for pairing all score groups is the same.
By now, you should have computed the due colors of all players. Begin by dividing the current score group you are trying to pair into two distinct subgroups: "White Seekers" and "Black Seekers." Obviously, those who have the due color White, should go into the "White Seekers" subgroup while those who are due Black go into the "Black Seekers" subgroup.
Important Warning
There is a chance you will be trying to move a player who has no due color (as in they have yet to play a game). Any player who has yet to play a game MUST be put in the Black Seekers group!
4. Sorting the Subgroups
Next, sort the White Seekers by ARO. They should be sorted in ascending order (i.e. those with a smaller ARO should be closer to the top. Also, if any players have the same ARO, break that tie using their pairing number). Sort the Black Seekers by pairing number ascending (those with a smaller pairing number should be closer to the top).
5. Picking Upfloaters
First, check the size of the score group you are trying to pair right now. If it has an odd number of players, you must pick an upfloater. If not, go ahead and skip this step!
There is a very specific way we pick upfloaters, so pay very good attention to this text (note that more in depth examples will be given at the end of this document -- this section just explains the logic).
First, count the number of White Seekers and Black Seekers there are in the current score group. If there are more White Seekers, you should prioritize picking upfloaters who have the due color Black and vice versa. From there, you want to pick upfloaters in this order:
- Top Priority: pick upfloaters that have the score closest to the score group you are trying to pair right now (i.e. minimize score differences)
- Next Priority: pick upfloaters that help even out the number of White Seekers and Black Seekers (that's why counting the number of White Seekers and Black Seekers, as said in the other paragraph, is important!)
- Next Priority: unless it is the last round try NOT to pick players who are Max-Upfloaters (see terminology). NOTE: this rule states to minimize, it never says anywhere that just because a player is a Max-Upfloater they shouldn't be picked as an upfloater ever!
- Next Priority: unless it is the last round, if you have to pick a Max-Upfloater, pick the one's who have upfloated less throughout the tournament.
- Next Priority: unless it is the last round, try to avoid picking upfloaters who upfloated in the previous round.
Note that just about any player who has a score below the score group you are trying to pair is a possible upfloater. After you sort your possible upfloaters (if there are any "tiebreaks" during this sorting, you should break it using the pairing number -- players with a higher (smaller) pairing number should have higher priority), pick the top one on the list to move into your current score group.
Since you are dealing with a score group that has an odd number of players, you should only be taking one upfloater. Once you have selected your upfloater, insert them into their respective subgroup (e.g. if they have the due color White, they should be put into the White Seekers). Whatever score group you inserted them into, make sure to re-sort that score group again! If you inserted the player into White Seekers, sort again by ARO, and if you inserted into Black Seekers, sort again by pairing number.
That's about it on how to pick upfloaters! It is that easy!
Note
Depending on how the pairing goes in the score group, you may have to try picking different upfloaters. For example, if you picked one upfloater, tried pairing the score group, and the score group couldn't be paired without satisfying the absolute criteria (see key terms), you have to try picking a different upfloater. Just pick the next one on the "priority upfloater list" you created from earlier.
Note
There is a very annoying twist when picking upfloaters. You have to pick the upfloater that grants as many due colors as possible in the score group you are trying to pair! This is indeed quite annoying. Essentially, assume there is a list of upfloaters to select from. You pick the top one on the list, but you notice how inserting him into the score group causes some players not to get their due color granted! You can try picking another upfloater, and if that one grants due colors more in the score group, that upfloater should be chosen over the other (considering, of course, that the score differences are minimized).
6. Moving Players to Different Subgroups
By now, you should have an even number of players in your score group. Now, take a look at both of your subgroups again. Does one have more than the other? If not, go ahead and skip this step. Otherwise, this step will explain how to move players from the bigger score group to the smaller one so both are of the same size.
There is a very specific way of moving players from one subgroup to the other. To give an example, let's assume we have the following players in White Seekers (assume properly sorted): Player 1, Player 2, Player 3, Player 4, Player 5, Player 6, Player 7 and the following Black Seekers (also assume that it is properly sorted): Player 8, Player 9, Player 10, Player 11, Player 12.
You can probably notice how there are 7 White Seekers and 5 Black Seekers. Hence, to make the score groups even in size, we should move one player from White Seekers to Black Seekers so that both subgroups have 6 players each.
The way we pick such players is a little weird. We also have to make another "move priority" list (i.e. the order in which we move players). This can be created with the following logic:
- Pick the player in the middle of the list (if you know statistics, this would be the median -- one who is roughly in the middle of the list so that the left and right side are even in length). This player has the top "move priority" in our "move priority" list.
- Now pick the player to the left of this "middle player" and this one has the next priority on our list.
- Now pick the player to the right of this "middle player" and this one has the next priority on our list.
- Now pick the player to the left of the player with the second "move priority" and this one has the next priority on our list.
- Now pick the player to the right of the player with the third "move priority" and this one has the next priority on our list.
- See how we go from there? The next player we pick for the "move priority" will be the one who is left of the left player in the list, and the next right priority player is the one right to the right of the list, and so on.
Given the example, the "move priority" list for the White Seekers looks like as follows: Player 4 (1st priority), Player 3 (2nd priority), Player 5 (3rd priority), Player 2 (4th priority), Player 6 (5th priority), Player 1 (6th priority), and Player 7 (7th priority).
The above probably doesn't make as much sense without a bigger example. Once again, all of this here is only supposed to represent the logic -- real examples will be given at the end of this article.
Now that we have our "move priority" list set up, pick the first player on that list and move them to the other score group. In the example above, this player is Player 4 -- so we would move this player from White Seekers to Black Seekers (and then re-sort both groups as needed).
The above example though was very basic. What if we have something like this: White Seekers has: Player 1, Player 2, Player 3, Player 4 and Black Seekers has: Player 5, Player 6. White Seekers (4 players) has more players than Black Seekers (2 players) so we have to move one player so that both score groups have three players. How do we do that here -- this time the "middle" player isn't as clear!
When the subgroup is even, take the number of players in it (in this example it is 4) and divide it by 2 (4 / 2 = 2). Take that number (which for simplicity I will denote to as n) and find the nth player in the list (in our example, we need to find the 2nd player in the list which is Player 2). That player has the top priority on the "move list" and the player to the right of him has the next priority. Then, just like with the previous step, we assign the priorities by going left to right. So in this example, it would look like this: Player 2 (1st priority), Player 3 (2nd priority), Player 1 (3rd priority), and Player 4 (4th priority). It is as simple as that.
Note
While it may seem controversial, we always set the move priority like this -- so even if there is a player in White Seekers who has an absolute color preference for White and they are on top of the "move priority" list, we still have to move them. HOWEVER, in a later step we will discuss about how to fix this so everyone's due color is granted!
7. Trying to Pair the Score Group
If you have made it here, now comes the fun part -- we pair the score group! It is generally pretty easy, now that White Seekers and Black Seekers are the same size, we pair them as follows: the first player in White Seekers plays the first player in Black Seekers, the second player in White Seekers plays the second player in Black Seekers, and so on.
8. Fixing Errors with Transpositions
Keep in mind that all pairings you generate must NOT violate the absolute criteria (see key terms). Go ahead and take a look at the pairings you just made for the score group, are there any violations? Is someone paired up with an opponent they already played in the tournament (hint: this is the only question you should be asked here! Because players are already divided up into subgroups of their due color, this is all that needs to be checked!)? If not, skip to Step #11 otherwise, continue reading this step!
Our first order of action when fixing pairings in a score group is by making use of this thing called transpositions. This is something that is quite difficult to explain and also very heavy (if you are a programmer, feel free to look away for a few moments as it might hurt to see the logic of this!).
For the most part you have to make use of permutations. If you are a programmer, you know that this takes time O(n!) to complete (I did warn you to look away)! If you are not, please forgive me as I don't know how to explain this in such a short article! However, I can provide a link as to what the general logic looks like.
Take the Black Seekers here -- as that's who we are going to be making swaps with. In the link I provided, examine the output given (should look something like "1 2 3" "1 3 2" "2 1 3" etc.). Well that is the exact order of swaps we apply on the Black Seekers. We keep applying these swaps until we have pairings that meet the absolute criteria.
PRO Tip (for programmers)
Under no circumstance should you ever write an algorithm that runs O(n!) time! For a list that has as few as 10 players in it, this could run forever. I only have two suggestions for you here, make use of Minimum Weight Matching, Hungarian Algorithm, or some kind of Stable Roommate Problem. While these are all graph-based algorithms that run in O(n^3) time (still not the best), it is more than enough to speed up the process.
9. Swapping Players When Subgroups are of Even Length
If you have tried transpositions (previous step) and have had no luck in fixing the score group pairings, your next step is to try swapping players between subgroups. This process is easy, yet time consuming. Note that if you have found a transposition that yielded valid pairings that don't violate absolute criteria, skip this step!
First, generate the "move priority" list (see Step #6) for both subgroups. This is where the part becomes time consuming: you have to keep trying to exchange players, one at a time (or even multiple if one at a time isn't working), try repairing the score group (and try any transpositions if needed), until you have a valid pairing! We make exchanges as follows: the player with the first "move priority" in White Seekers is exchanged with the one who has the first "move priority" in the Black Seekers. We then re-sort subgroups, pair as according to Step #7, and apply any transpositions as given in Step #8. If this still fails, try exchanging the player with the second "move priority" from both subgroups. You keep on going until we have a valid pairing.
Because we have to make sure that as many players get their due color as possible, we have to start by trying to only exchange two players (one from White Seekers and one from Black Seekers) down to exchanging higher numbers. Whether you are a programmer or not, once again, we are trying every single possible combination just to get the final pairings (note: speaking from a developer point of view, I too wish FIDE would have come up with something simpler!).
Note:
If you tried moving players when the subgroups were not the same length before, try moving different ones BEFORE executing this step!
PRO Tip (for programmers)
Once again, try to make use of some kind of combinatorial optimization -- you can't make use of brute force based approaches and expect time complexity to be any good. Try to make use of Minimum Weight Matching once again.
10. What to do when No Valid Pairing Exists Within the Current Score Group
If you have tried to pair your score group, made use of transposition and exchanges, and still couldn't find a valid pairing, please read this step. Otherwise, feel free to skip it!
The next thing to do when this issue arises is to pick upfloaters. Unfortunately, whether you are a programmer or not, you have to make use of brute force once again! First, create the "upfloater list" (order of upfloaters to pick) as given in Step #5.
The goal is to try to pick as few upfloaters as possible to make the pairing in the score group work. So start by picking 2 more upfloaters (or three if the score group has an odd number of players) from the lower score groups. From there, add the upfloaters to the score group, put them into the proper subgroups, re-sort them, and try to make the pairings again as given in Step #7.
Note that FIDE prioritizes to minimize upfloaters at all times. Meaning that even if the upfloater comes from at least two score groups lower than the current, if that upfloater paired with another one (so two upfloaters total) makes a valid pairing in the score group, this is a better choice of upfloaters than picking three or four upfloaters from the score group right below the one you are trying to pair.
If you have tried every single possible combination of upfloaters (maybe you even got to the point where you merged all the score groups into one big mega score group!) and it is still impossible to pair the score group, try backtracking to the previous score group and apply this current step on that score group. If no such score group exists before this one, in that case, pairings cannot be generated.
11. Correcting Colors
After lots of trial and error, you hopefully made it to this step! This is a very important step as you have to give the due colors to the correct players! Allow me to be more specific.
Remember how you probably tried moving players from subgroup to subgroup (as in Step #6 or Step #9)? Well, they are obviously going to play someone who has the same due color as they do -- so who gets the due color? Is it the player we moved, or the one whom stayed in the original subgroup?
The answer to that is we give it to whoever has a higher priority for the due color (see key terms)! If neither player has the higher priority for the due color, we give it to the higher ranked player.
12. Picking the Pairing Allocated BYE
This really should be done as the first step of the tournament, but if your tournament has an odd number of players, one has to be left unpaired -- they get what we call a BYE. Picking the BYE is easy, just give it to the lowest ranked player, who has played the most games in the tournament, and has NOT gotten the BYE OR scored a forfeit win in the tournament before!
13. You did it!
That was a lot, but that is how you generate pairings with the FIDE Dubov Swiss System! Below is an example of all the rules mentioned here applied in action!