I am building a simple Android application for hosting Chess tournaments, I am having some difficulty implementing a Swiss paring algorithm, I need link to an article or a paper that explains how I can achieve that.
I would also like to know any ideas that can help me. I am following the rules in this Article Swiss Pairing Rules
I am particularly having problem ensuring that
For each player the difference between the number of black and the number of white games shall not be greater than 2 or less than –2. Each system may have exceptions to this rule in the last round of a tournament.
No player shall receive the same colour three times in a row. Each system may have exceptions to this rule in the last round of a tournament.
In general, a player is given the colour with which he played less games.
If colours are already balanced, then, in general, the player is given the colour that alternates from the last one with which he played.