There's a
thread on the forum with a suggestion for a change of how the wildcard slots are picked for the Steel Gauntlet tournament. In this thread, the question came up of how the wildcard slots work currently which is a pretty complicated algorithm. Instead of describing it in a forum thread, I'll do a longer write-up here to make it slightly easier to refer to.
Background
The Steel Gauntlet is a tournament that takes place at the end of a Blackbox Trophy (BBT) season, pairing the best performing teams for each roster against each-other in a play-off.
Given that there are currently 29 rosters in the game, I chose to aim for a 32 team tournament filling up the remaining slots with "wildcards" that are picked as the best over-all performing team in the BBT season.
Core constraints
There are some inherent restrictions to a system like this. As per the core design choice, we want one team of each roster in the tournament (if possible).
It is fairly common for the strongest coaches to have multiple qualifying teams, and the site allows coaches to set up a priority for which team they would rather bring should they have the choice. It is also possible to completely opt out of a spot with a team, whould it be too broken to feel competitive.
Algorithm
The way the pairings work is based on the
Stable marriage problem, and fundamentally uses a modified version of the
Gale-Shapley algortihm. I will explain how the site does it here, but if you want more "formal" descriptions, the linked Wikipedia articles are a good place to begin.
We begin with some definitions:
- Each of the 32 spots get defined as "acceptors" (as per the Gale-Shapley algorithm). This means that the spot is the side that decides which of the offers it should accept. The first 29 are "locked" into a specific roster, while the remaining 3 accept any team.
- Each participating coach get defined as "proposors". This means that a coach will send out offers to each spot as the algorithm progresses.
With each coach having potentially multiple teams, and these are all set up in a priority list, it gets a little bit complicated to understand how that maps to the above. So, here's an example:
Coach Alice has two teams they wish to bring to the Gauntlet: Underworld and Orcs, in that order of priority.
The pairing algorithm sets up priority lists as follows:
Alice:
- Underworld to the Underworld slot
- Underworld to wildcard slot 1
- Underworld to wildcard slot 2
- Underworld to wildcard slot 3
- Orcs to the Orc slot
- Orcs to wildcard slot 1
- Orcs to wildcard slot 2
- Orcs to wildcard slot 3
You'll notice that each team Alice wishes to bring will create multiple offers (one offer per eligible slot it could be accepted into).
The core algorithm itself has two steps that get repeated until there are no remaining offers:
1. Offers
Each coach that isn't currently matched (meaning they have an offer that is currently "selected" by a slot, more on this in step 2), takes their topmost offer and sends it to the slot.
2. Selection
Each slot takes the list of offers and picks the best one (by score and tie-breakers), and compares it to their currently selected offer (if any). If the new one is better, the previous offer is dropped and the new one is "selected". An offer that is not selected, or is dropped will be removed from the owning coach's list.
As simple as that looks, that's it. When there are no longer any new offer sent out in step 1 (meaning all unselected coaches have zero items remaining in their lists), the selected teams for each slot is the teams that qualified to the tournament.
If there are any slots that have no offers (which happened when gnomes were given a slot), the whole process is run again with only those remaining slots, setting them to wildcards that accept any roster.
Hopefully, this was interesting to some of you :)