Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the pairing algorithm #41

Open
falbru opened this issue May 2, 2023 · 1 comment
Open

Improve the pairing algorithm #41

falbru opened this issue May 2, 2023 · 1 comment
Labels

Comments

@falbru
Copy link
Collaborator

falbru commented May 2, 2023

Currently, the pairing algorithm sorts the players by score and match the players who are closest to each other by score. The algorithm prevents two players from being paired with each other two times in a row, but that's it. It also tries to fairly assign colours to the two players, so if player A is set up to play against player B, and player A played white and player B played black the previous match, they switch colours this match.

Some problems we've encountered:

  • Even though two players can't be matched two times in a row, players often ended up playing against players multiple times. I think that, in the way that the algorithm currently works, you'll match with the same person over and over again if you have the same score and did not play against each other the previous match.
  • Some players played the same colour sevaral times in a row.

Some solutions:

  • Shuffle the list of players who have the same score. This is not perfect, but a quite easy fix.
  • For all players with the same score, try to match players who played of differen't colors last game.
@falbru falbru added enhancement better than before backend labels May 2, 2023
@falbru
Copy link
Collaborator Author

falbru commented May 2, 2023

Also, the typing for the dictionaries in the algorithm are quite scuffed. I had to cast all the objectIds to strings for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants