Research on matching algorithms for Swiss Bracket tournaments in competitive eSports The method adresses a fairness issue by ensuring the existence of perfect matching in the last round of the tournament.
This repository presents a comprehensive analysis of matching strategies in the Swiss Bracket format - a tournament structure used by major eSports events including Valve's CS:GO Majors and Riot's League of Legends World Championship. The Swiss Bracket aims to qualify 8 teams from a pool of 16 for playoff stages through a series of best-of-one matches. It is an alternative to traditionnal group stage before play-offs.
In 2023, a viral Twitter thread by analyst Graham Pitt highlighted a fairness issue in the CS Major format: in certain scenarios, despite all teams performing according to their seeds, the 8th-best team could fail to qualify while the 11th-best team advances. The proposed solution - "speed-up" matching (pairing 1st seed vs 9th seed, 2nd vs 10th, etc.) - was adopted by Valve but may actually contradict the format's core purpose without improving the tournament.
This research:
-
Identifies the root cause through graph-theoretic analysis (
$K_{3,3}$ perfect matching theory) - Proposes the Expected Matching Approach (EMA) using rotation algorithms to guarantee valid matchings
- Validates through simulation across multiple population models, seeding qualities, and game outcome generators
- Demonstrates superior robustness of the EMA Rotation algorithm over current implementations and alternatives
-
1_GraphColoring.ipynb - Theoretical Foundation
- Graph-theoretic problem identification
- Analysis of FLAT and STAR edge colorings on
$K_{3,3}$ - Cross algorithm vs Rotation algorithm comparison
- Cycle basis analysis for predicting problematic scenarios
-
2_Simulation.ipynb - Simulation Protocol
- RSTT framework implementation
- Reproduction of Twitter example
- Experimental design and parameters
- Comparison of 8 tournament variants across 16 configurations
-
3_Dashboard.ipynb - Interactive Dashboard
- Comprehensive metric definitions
- Interactive visualizations for all results
- User guide for interpreting findings
- Comparison across utility loss, precision, fairness, balance, and frustration metrics
-
ema/- Expected Matching Approach implementation- Complete bipartite graph definitions
- Cross and Rotation algorithms
- Intersection graph analysis
- Cycle basis prediction tools
-
simulation/- Simulation framework modules- Tournament system implementations
- Seeding class generators
- Population distribution models
- Experimental protocols and data structures
-
evaluation/- Analysis and metrics- Result matrix computations
- Tournament analyzer
- Statistical aggregation
-
visualisation/- Dashboard components- Interactive plotting utilities
- Metric visualization functions
-
utils.py- Shared utilities- Valve Swiss Bracket pairing specifications
- Common helper functions
data/examples/- Real tournament outcomes (CSV format)data/results/- Simulation output datasetsfigures/- Generated visualizations
The problem stems from mixing edges from incompatible proper 3-edge colorings (FLAT and STAR) of
Mathematical Insight: The six preferred matchings on
Rotation Algorithm Properties:
- ✅ Guarantees valid
$K_{3,3}$ matching exists in Round 5 for all 16 possible scenarios - ✅ Respects Valve's preference for pairing top-half vs bottom-half seeds
- ✅ No "virtual duplicate" games that violate proper edge coloring
- ✅ Provides structural guarantees regardless of which teams reach 2-2 record
Cross Algorithm (Current Major) Deficiencies:
- ❌ Valid matching exists in only 8 of 16 scenarios
- ❌ Fails precisely when good seeding should work best
- ❌ Forces suboptimal pairings (top vs top, or bottom vs bottom)
- ❌ No practical differences between the old and the new rules
Across 4 population models × 4 seeding classes × 3 solvers × 20 samples:
EMA Rotation advantages:
- Better qualification accuracy: Lower utility loss and higher top-8 precision across all seeding qualities
- Higher robustness: Maintains performance even with random seedings
- Fewer frustrating outcomes: Reduces head-to-head violations and mismatches when top 8 is known.
- Improved last-round fairness: More appropriate pairings in decisive moments
Key insight: The current "speed-up" approach optimizes for perfect seeds but fails under realistic conditions. EMA is robust to seeding uncertainty.
For teams at 2-2 record reaching Round 5:
- Input: a perfect matching on
$K_{3,3}$ - Order top-half teams:
$(a, 1, 2, 3)$ - Order bottom-half teams:
$(b, 6, 5, 4)$ (reversed) - Generate pairings by rotation:
$(V_{1,j}, V_{2,(j-i) \mod 4})$ for$i = 0,1,2,3$
This creates a proper 4-edge coloring of
- All possible 2-team removal scenarios leave a valid
$K_{3,3}$ matching after two rounds. - No virtual duplicate encounters across rounds
- Optimal pairing structure (top vs bottom) is preserved
The rotation structure ensures that forbiden patterns does not appear. By avoiding 2-color cycles in the cycle basis, we eliminate scenarios where team removal makes perfect matchings impossible.
The simulation study evaluates systems across six key metrics:
| Metric | Description | Optimal Value |
|---|---|---|
| Utility Loss | Qualification probability gap between actual and ideal outcomes | Lower |
| Top 8 Precision | Percentage of qualified teams from true top 8 | Higher (→1.0) |
| Fairness | Deviation from ideal seed-based pairings | Lower |
| Balance | Average skill difference in matchups | Lower |
| Last Round Fairness | Round 5 specific pairing quality | Lower |
| Frustration | Frequency of head-to-head violations, inversions, etc. | Lower |
See 3_Dashboard.ipynb for detailed metric definitions and interpretation guides.
- Install uv (if not already installed):
curl -LsSf https://astral.sh/uv/install.sh | sh-
Clone the repository:
git clone https://github.com/Ematrion/SwissBracketMatching.git cd SwissBracketmatching -
Install dependencies (using
pyproject.tomlanduv.lock):uv sync
uv run jupyter labRecommended order:
- Start with
1_GraphColoring.ipynbto understand the theoretical foundation - Proceed to
2_Simulation.ipynbto see the experimental setup You do not need to run it. Simulation is heavy and can take several hours to complete, data/results/ contains ready to use .csv. with precomputed metrics. - Explore
3_Dashboard.ipynbto interactively visualize results
Quick Example: Reproducing the Twitter Scenario
See section 1.2 of 2_Simulation.ipynb for a complete reproduction of the Graham Pitt example demonstrating the problematic outcome.
This project uses RSTT (Ranking & Seeding Tournament Toolkit), a custom Python framework for simulation based research released early 2025.
Key Features:
- Flexible tournament format definitions
- Deterministic and stochastic game outcome generators
- Tunable ranking state for seeding purposes.
- GPR_teams: Real Elo ratings from Riot's 2024 Global Power Ranking
- Gaussian: σ=250, μ=1500 (highly competitive field)
- Pareto: α=5.5 (heavy-tailed, dominant teams)
- Weibull: α=1.2, β=7.0 (intermediate distribution)
- RANDOM: Complete shuffle (realistic for international events)
- ACR2: Top 8 and bottom 8 shuffled separately
- ACR3: Top 4, middle 8, bottom 4 shuffled separately
- ACR5: Top 5, middle 6, bottom 5 shuffled separately
- BetterWin: Deterministic (higher skill always wins)
- Logistic: Stochastic with skill-based probabilities
- MinEffort: Top-4 teams underperform (upset scenarios) in the first two rounds.
| System | Description | Application |
|---|---|---|
| 2Groups8 | Two groups of 8 | IIHF Ice-Hockey |
| 4Groups4 | Four groups of 4 | Sport Standard |
| Original | Twitter example system (F1_CROSS + tiebreaker) | Old CS:GO major |
| Original-NTB | Same without tiebreaker | - |
| Major | Current Valve implementation (speed-up matching) | Current CS Major |
| Major-NTB | Same without tiebreaker | - |
| FixedDefault | RSTT default with Valve rules for the last round | - |
| Ema | Proposed EMA Rotation algorithm | Maybe one day |
- EMA Rotation achieves lower utility loss across all seeding qualities
- Advantage most pronounced with poor seedings (RANDOM, ACR2)
- Best Top-8 precision ~85% even with imperfect seeds
- EMA produces more fair matchups in Round 5
- Fewer mismatches between top and bottom seeds in deciding games
- More consistent performance across different population models
- 50% reduction in head-to-head violations vs Current Major
-
Eliminates
$K_{3,3}$ matching failures (structural guarantee)
- Current Major performs well only with perfect seeds and deterministic outcomes
- EMA maintains advantages across all seeding qualities
- Particularly valuable for international tournaments with uncertain rankings
Recommendation: Adopt the EMA Rotation algorithm for Round 1-5 pairings.
Benefits:
- Structural guarantees - valid matchings always exist
- Better qualification accuracy under realistic seeding uncertainty
- Reduced controversial outcomes that damage competitive integrity
- No additional complexity - It is a pairing system
Implementation: See simulation/systems/ for reference implementations compatible with Valve's rulebook preferences.
The "speed-up" matching approach was designed to handle perfect seeds but and deterministic game outcome:
- Real tournaments never have perfect seeds
- Predefine results is match fixing, not entertaining competition
- Speed-up contradicts the format's goal of letting mid-tier teams face each other frequently
- Keep the same problemtic scenrios.
EMA addresses the actual problem: ensuring fair, valid matchings exist regardless of seeding accuracy and game outcomes.
Contributions are welcome! Areas of interest:
- Additional population models or seeding strategies
- Alternative matching algorithms
- Extensions to different tournament sizes
- Improved visualization and dashboard features
- Bug fixes and documentation improvements
Please open an issue to discuss proposed changes before submitting PRs.
If you use this work in your research, please cite:
@misc{swissbracket2024,
title={The Expected Matching Approach: a Pairing Strategy for Swiss Bracket},
author={[David Bucher]},
year={2026},
publisher={},
url={https://github.com/yourusername/SwissBracketMatching},
doi={}
}This project is licensed under the MIT License - see the LICENSE file for details.
- Graham Pitt for identifying and publicizing the initial problem
- Valve Corporation for transparent rulesets and tournament documentation
- Riot Games for Global Power Ranking data
-
Problem Motivation: Graham Pitt's Twitter Analysis https://x.com/messioso/status/1644389658942373899
-
Current Ruleset: Valve's CS Major Supplemental Rulebook https://github.com/ValveSoftware/counter-strike_rules_and_regs/blob/main/major-supplemental-rulebook.md
-
Graph Theory Background: Chord Diagrams and Perfect Matchings https://en.wikipedia.org/wiki/Chord_diagram_(mathematics)
-
RSTT: simulation framework DOI 10.5281/zenodo.16926605
- Swiss-system tournament (general format description)
- Graph edge coloring (theoretical foundation)
-
Complete bipartite graphs (
$K_{n,n}$ properties)
For questions, suggestions, or collaboration inquiries, please open an issue on GitHub or join the RSTT discord.