Round robin, part two: the edge cases a live event finds
Engineering ·In September I wrote about why your round robin keeps giving you the same opponents. The short version: the scheduler picked courts greedily, and it computed a repeat-opponent score that it never used. Fixing both cleaned up the big numbers.
Then the app got used at real events, every week, by organizers who actually count. Two months later, the opponent fix holds up. Almost everything else I found came from situations I never simulated.
Who found these
Most of these bugs came from one organizer at our club. After each event he sends me a full audit: every round written out, a count of how many times each pair partnered and played against each other, which court everyone played on, and which team was listed on top of each card. He doesn’t stop at “it felt off.” He sends the table that proves it.
That turned out to matter more than any test I wrote, because a simulation only checks what I already thought of.
1. “Repeat opponents” was the wrong number
The first fix counted partner repeats and opponent repeats separately. A 13-player event found the gap. One player shared a court with the same person four times in four rounds: once as a partner and three times as an opponent. Neither counter looked bad. Partners were unique, and three opponent meetings sounds tolerable.
To a player, it isn’t. What they notice is “I keep seeing this guy.” So the scheduler now tracks courts shared, partner or opponent, and scores that too.
The same event also turned up an older bug. When someone sat out, pairs were built greedily in roster order. Players listed next to each other on the sign-up sheet kept getting paired and matched together. Shuffling the candidates before each attempt fixed it.
2. Small groups run out of new partners
Most of my testing used 12 to 16 players. An 8-player, 2-court night broke things I had never seen:
- 29 of 30 simulated runs had a pair face each other 3 or more times by round 7, when 2 is possible.
- 17 of 30 had a pair that never played against each other in 8 rounds.
- Once all 7 possible partners were used up, some players got the same partner again the very next round.
That last one makes sense once you see it. With 8 players, each person has only 7 possible partners, so a 10-round night has to repeat some. The scheduler knew a repeat was coming, but nothing told it to pick an old repeat instead of a fresh one.
The fix scores each candidate round as a whole:
- A repeat partner costs the most, and a recent repeat costs more than an old one.
- Each extra meeting across the net costs 10 times the last one, so the scheduler never accepts a 4th meeting to avoid two 3rds.
- Sharing a court again costs a little, and more if it’s back to back.
At 8 players there are only 315 ways to build a round (72 for mixed doubles), so it tries every one. Over 30 simulated runs of 8 players and 10 rounds:
| Before | After | |
|---|---|---|
| Max opponent meetings, rounds 1 to 7 | 3 to 4 | 2 |
| Pairs that never face each other by round 8 | up to 2 | 0 |
| Shortest gap before a repeat partner | 1 round | 7 rounds |
| Longest stay on one court | 5 to 10 rounds | 4 |
3. The physical court matters
That last row in the table is a different kind of problem. The scheduler decided who played whom, then handed out courts in order: match 1 on court 1, match 2 on court 2. Nothing stopped one player from staying on court 1 for ten rounds straight.
Players care about this. Courts aren’t identical. One is by the entrance, one has the sun in your eyes at 10am, and one is next to the group that never stops talking. Now each round’s games go on the courts their players have used least.
I also found the same bug a second time. The league combine sessions run the scheduler on the server, not in the app, and that copy still had the old behavior. It now gets the same fixes. Lesson relearned: if you copy an algorithm, you have two algorithms to fix.
4. Mixed doubles with an uneven roster
Mixed doubles has a hard rule, one man and one woman per team, and real rosters ignore it. Eight men and three women. Nine men and four women. The old behavior sat everyone who didn’t fit, so 8 men and 3 women meant 5 people sitting out every round.
Now the leftover players play:
- Four or more leftover men (or women) play their own men’s or women’s doubles court. The card says so, and those games export to Pickleball Journal as regular doubles, not mixed.
- One leftover woman plays with three men before a men’s court gets filled, so she isn’t the one who always sits.
Each of those exposed the next problem. Once some leftover players were playing and some were sitting, the rotation counted “played the extra court” the same as “sat out.” On some rosters, one man sat twice while another never sat. Under a court limit, people sat out two rounds in a row. The fix picks who sits first, using only real sit-outs, and then picks who plays the extra court from the rest. Over 20 runs of 8 rounds, the spread in men’s sit-outs went from 2 to 0 on every roster I tested, and back-to-back sit-outs went to zero.
5. Events change while you’re playing
The most recent audit was the best test yet. It started with 10 players on 2 courts. In round 3 two late arrivals joined, so it went to 12 players on 3 courts, and two players locked themselves in as a team. Before round 7, four players left and it dropped to 8 players on 2 courts. One person never showed up at all.
The scheduler kept the full history through all of it. Over 7 rounds there were zero accidental repeat partners, no pair met more than twice as opponents, and after the drop to 8 players it used up every remaining fresh partnership before the first forced repeat. That’s the reason to build a general solver instead of fixed templates: no template covers “10, then 12, then 8.”
What’s still off, and what’s next
The same two audits found four smaller problems. All four fit the same pattern, which is why I’m fixing them together.
Court lockouts and camping. In a 12-player, 3-court, 8-round event, a fair court split is 3-3-2 per player. One player never played on one of the courts at all, and two players spent 3 rounds in a row on the same court. Choosing courts from “least used” one round at a time can’t see the whole night.
Back-to-back rematches. Five pairs used up both of their opponent meetings in consecutive rounds. The scorer counts how many times a pair has met, but not when, so “opponents in round 4 and again in round 5” costs the same as rounds 2 and 7.
Three rounds on a court together. One pair shared a court three rounds in a row: partners, then opponents, then opponents again. In the dynamic event, a cleaner round existed, using four brand-new partnerships, and the solver passed on it over a single opponent tiebreaker.
Top and bottom of the card. The team listed on top of the card serves first in our format. Eight of 12 players ended up with a 5-to-3 split instead of 4-to-4, and some got 3 rounds in a row on the same side.
The fix comes from noticing that these are separate decisions, and some of them are tiny.
Choosing the matchups is the hard part. 12 players on 3 courts can be split 10,395 ways, so the scheduler samples. But once the three games are chosen, there are only 3! = 6 ways to put them on courts (24 for 4 courts). The scheduler can score every one of them almost for free, with penalties for a lopsided court count and for a third straight round on the same court. In the 12-player audit, swapping just two games in round 4 would have put both locked-out players on the missing court without changing a single partner or opponent.
Top and bottom are even smaller. Each card has two orientations, so the scheduler can flip whichever ones even out serving sides, again without touching who plays whom.
The other two are scoring changes. Each pair will remember the round they last played against each other, so a rematch next round costs much more than one four rounds later. And a third straight round on a court together will cost 10 times a second one, which effectively caps it at two.
So the plan is three passes in a row: pick the matchups, then the courts, then the card sides. Each pass gets the full set of options, and none of them can undo the work of the one before.
What I took from it
The September post ended with “use the number you’re already computing.” This one is about the numbers I wasn’t computing. Courts shared, partner recency, which physical court, which side of the card. None of them showed up in my test metrics, and all of them showed up on court.
The best test turned out to be a regular player who writes everything down. If you organize events and keep notes like that, I’d love to see them.