OliverUwira wrote:
Hi Matthias,
I wondered if you could tip me off about your implementation of the Swiss pairing and if your algorithm would have a chance for certification by FIDE.
I found implementing the pairing algorithm as specified by FIDE extremely difficult and I am still clueless about how to tackle it properly.
I've once read a paper about solving Swiss pairing as a Stable-Roommate problem, but up until now I haven't found any code examples of a SR algorithm. So the best I can think of is devising some sort of branch-and-bound optimization.
ChessGUI Swiss Algo
1) Sort engines according to points Pts.
1a) If there are ties, resolve them with Sonneborn-Berger SB.
1b) If there are still ties, resolve them with Elo.
The final order is (1 ... m ... n ... T) for T engines (total).
The engines (m ... n) all have same Pts.
2) For each engine Eng in range (m ... n), scan for a "new" opponent Opp1 in
this order:
2a) (m+n+1)/2 ... n
2b) backwards (m+n-1)/2 ... m
2c) (n+1) ... T
"new" means the opponent has not been played against in previous rounds.
3) Try to get a better opponent Opp2 by repeating 2a and 2b, looking for an
opponent with white/black statistics from previous rounds that match
Eng better than the white/black statistics of Opp1. The criteria are:
3a) how often have Eng, Opp1, Opp2 played white/black.
3b) which colour did Eng, Opp1, Opp2 play in previous round.
4) Eng will play against Opp.
Opp = Opp2, if step 3 found an opponent, else Opp = Opp1.
Determine which colours they will play according to:
4a) how often have Eng, Opp played white/black.
4b) which colour did Eng, Opp play in previous round.
Currently, ChessGUI has not yet implemented step 3, but in eng-eng
tournaments it is far less important than in human tournaments.
I did not even consider fulfilling any FIDE Swiss pairing rules/proposals.
Matthias.