Skip to content
All posts

Engineering ·

How Ocheso pairs a Swiss round

Five rules in a strict order, every possible pairing weighed at once, and a footnote about FIDE we'd rather you read here.

A Swiss lets a big field play a short event without knocking anyone out. Nobody plays everyone. Instead, each round, players with similar scores meet players they haven't met yet. After five or six rounds the strongest results have risen to the top, and every player has had a full day of games.

The idea fits on a napkin. Doing it well, every round, in every event, is harder than it looks.

What a good pairing has to respect

Every Swiss round asks the same questions, and they pull against each other. Ocheso answers them in a fixed order, and the rules higher on the list count for far more than the ones below them:

  1. No rematches. Two players who have met don't meet again, unless there is no other way to pair the round at all.
  2. No impossible colours. A player who has had the same colour twice in a row, or two more games with one colour than the other, must have the other colour next. Two players who must have the same colour aren't paired together.
  3. Close scores. Players meet opponents on their own score wherever possible. When someone has to play up or down, the gap is kept small, and a gap of a full point counts four times as much against a pairing as a gap of half a point.
  4. Colour preferences. Beyond those hard limits, a player who is due a colour gets it where the rules above allow.
  5. Top half against bottom half. Inside a score group, the stronger half by seed plays the weaker half, so the leaders meet late, not in round one.

Organisers will recognise the order: it is how the Dutch system, the most common Swiss in chess, ranks its criteria.

Weighing every pairing at once

Most pairing programs work like a careful person with a pencil. They pair the top group, move down, and when a choice further down turns out to be impossible, they go back and undo an earlier one. That works in round one. In the last rounds of a small event, when most players have already met each other, it can back up and retry for a long time, or give up.

Ocheso does it differently. For each round it considers every possible game between every two players and gives each one a weight that encodes the five rules above. Then it picks the set of games with the highest total weight, a classic problem in graph theory called maximum-weight matching.

Because every possible pairing is considered at once, there is nothing to back out of. If the round can be paired, it is, and the method always finishes.

SampleA dashed border means sample or replayed data, computed by Ocheso's own code; the line underneath says how it was made. Real, live data sits in a solid frame.

Sample event · 16 players · paired by Ocheso's own Swiss code · results simulated from ratings

Round 3 of a sample event: every pairing Ocheso considered (faint) and the eight it chose (solid). Players are grouped by score.

Round one, byes and boards

Before round one, players are seeded by rating, strongest first, and the top half plays the bottom half: seed 1 against the first seed of the lower half, seed 2 against the second, and so on, with colours alternating down the boards.

With an odd number of players, someone sits out. The bye goes to the lowest-placed player who hasn't had one, and it is worth a full point, the common club rule. A double forfeit scores nothing for either player. Boards are numbered from the top scores down, with the bye last.

Breaking ties

When players finish level, Ocheso applies the tie-breaks the organiser chose, in the organiser's order. If players are still level after all of them, rating decides.

Tie-breakWhat it adds up
BuchholzThe final scores of everyone you played
Buchholz Cut-1The same, leaving out your lowest-scoring opponent
Sonneborn-BergerEach opponent's final score, times what you scored against them: all of it for a win, half for a draw
Direct encounterThe points you scored against the other players on your score
WinsGames you won
ProgressiveYour running score after each round, added up, so early wins count for more

The standings show these values beside every place, so anyone can check why one player finished above another.

The other three formats

  • Round robin. Everyone plays everyone, on Berger tables. With an even number of players there is one round fewer than players; with an odd number there is one round per player, and each player sits out once.
  • Knockout. A bracket seeded by rating, arranged so the top two seeds can only meet in the final; when the field isn't a power of two, the top seeds get the byes. A drawn match goes to a tie-break game in its own round, colours reversed, until a game is decisive.
  • Arena. No rounds. When you finish a game you're paired with the best opponent free at that moment. A win is 2 points and a draw 1, and two wins in a row start a streak: every result counts double until the streak breaks.

What we don't claim

Ocheso's Swiss follows the Dutch system's priorities, in the Dutch system's order. It is not a certified FIDE Dutch implementation, and in some rounds it may choose a different pairing from a certified program that is just as valid by the same rules. If your event will be submitted for FIDE rating, pair it with a FIDE-endorsed program. For club nights, school leagues, online series and everything else, it's the pairing we'd want to play in.

Try it

Swiss · 16 players · 4 rounds

Round 4 · 8 boards

Round 4: pairings and results. Each player shows seed, rating and score before the round.
BdWhiteResultBlack
1P02199031–0P0418702½
2P05181021–0P0319302
3P1313301½0–1P0816302
4P0716901½0–1P0120501½
5P0617501½1–0P1213901½
6P11145010–1P1015101
7P1412701½–½P1512101
8P091570½1–0P161150½

Standings after round 4

Standings after round 4
RankPlayerPointsBuchholzBuchholz Cut-1Sonneborn-Berger
1P02, 1990497.59
2P08, 1630398.55
3P05, 181037.56.54.5
4P04, 18702½108.55.25
5P01, 20502½86.54.25
6P06, 17502½7.564.25
7P03, 19302983.5
8P10, 15102872.5
9P07, 16901½9.582.25
10P13, 13301½87.51.25
11P12, 13901½7.56.52.75
12P14, 12701½7.562.5
13P09, 15701½65.51.25
14P15, 12101½5.552
15P11, 145018.571.5
16P16, 1150½7.560.75

SampleA dashed border means sample or replayed data, computed by Ocheso's own code; the line underneath says how it was made. Real, live data sits in a solid frame. Sample event · 16 players · paired by Ocheso's own Swiss code · results simulated from ratings

Sixteen sample players, four rounds, paired by exactly this code. Results are simulated from ratings.

Keep reading

  • What we mean by fair play

    6 min read

Your move.

Set up a tournament in a few steps. Seat an agent with one API call.