The seed decides who plays with and against whom in every round. It says nothing about which table each foursome sits at, or in what order the rounds are played. This page explains how the optimizer chooses both so that every player gets around the room evenly, using two search stages one after the other.
With P players there are T = P/4 tables and P−1 rounds. The seed decides the foursome each player is in, every round. That part is never touched, because it is what guarantees everyone partners each other player once and opposes them twice.
Two things are free:
Changing either one never changes who plays with whom. It only changes where people sit.
Each player plays 4T−1 rounds over T tables, one short of 4 visits per table. So the best possible row for a player is 4 visits at every table except one, which gets 3.
Every schedule is scored in this strict order. A schedule only wins on a later item when it ties on every earlier one:
For a fixed round order, Stage 1 labels the tables one round at a time. In each round it only considers labels where nobody returns to the table they just left, so Rule 3 can never be broken.
Picking the best label for each round on its own quickly paints itself into a corner. So it keeps several partial schedules alive at once (the beam, up to a few hundred wide), extends each of them, and keeps only the most promising. "Promising" means every player's visits are on pace to end near the even share.
Round order matters a lot with few tables, because it decides how much freedom Rule 3 leaves. So around the labelling there is a second loop: swap or move a round, re-run the beam, and keep the new order if it is no worse. Each new attempt starts from the best order so far with a small shake-up.
Strength: it always produces a clean schedule, and it is very good at removing extremes. Weakness: it commits to early rounds before it knows how later rounds will go, so the final balance is often a few steps from ideal.
Stage 2 works on a complete schedule and changes the round order and the labels together. Millions of times per second it tries one of two small changes:
A change that improves the score is always accepted. A change that makes it worse is sometimes accepted too, more often early on. This is simulated annealing, named after cooling metal slowly so it settles into a strong structure. Accepting some bad moves early lets the search climb out of dead ends that a strictly downhill search would get stuck in.
The temperature controls how willing it is to accept a worse move. It starts high and falls steadily, so the search gradually turns into pure improvement.
With only 5 or 6 tables, Rule 3 is very tight. A foursome whose four players came from four different tables last round has only one or two tables left to go to. If Stage 2 refused every move that broke Rule 3, it would almost never be able to move at all.
So during the search Rule 3 is a penalty, not a wall: each repeat costs a set number of points, and the search may pass through schedules with a few repeats on its way to a better one.
Each Stage 2 session makes several runs from random starts: a few seconds each up to about 60 players, growing to 30 seconds at 148, because a big schedule needs a longer run to cool properly. If a run ends without any clean schedule, the next run uses a higher repeat penalty; if it succeeds, the penalty eases a little so the balance gets more weight.
The extra points for 2s and for 0/1/6+ make Stage 2 follow the same priority order as the final score, so it doesn't trade an extreme for a slightly better average.
Single test runs in the browser, all with zero Rule 3 repeats:
| Players | After Stage 1 2s or 6s / distance | After Stage 2 |
|---|---|---|
| 20 | 7 / 54 | kept Stage 1 |
| 24 | 7 / 72 | 7 / 70 |
| 32 | 0 / 92 | 0 / 70 |
Runs vary a lot, so treat these as examples, not averages. At 20 players Stage 2 found a result closer to ideal (50) but with more 2s, so the priorities kept Stage 1's answer.
Stage 2 helps most from about 32 players up, where there are enough tables for Rule 3 to leave room to manoeuvre. With 5–6 tables Stage 1 is often already as good.
Even the best schedules have only some players on the exact 4s-and-one-3 row. A computer proof shows the full pattern for every player is impossible at 12 and 16 players, even ignoring Rule 3. At 20 players an 8-minute exhaustive search couldn't decide either way, and the best found without Rule 3 was a distance of 26. So the goal is "as close as possible", not perfect.
If the result is not good enough, run the optimizer again or allow more attempts. Every run starts from fresh random choices, so a second run can land somewhere better.
Open the seeder & optimizer, pick a size, generate the rounds and press Optimize Schedule. The progress box shows Stage 1's attempts, then a Stage 2 section with the run number, Stage 1's result and the best annealing result so far. The last line says whether Stage 2 improved the schedule.