slashinfty / tournament-organizer

JavaScript library for running tournaments
https://slashinfty.github.io/tournament-organizer/
MIT License
51 stars 18 forks source link

fail to drop player after result is set #10

Closed pedrohba1 closed 2 years ago

pedrohba1 commented 2 years ago

While using the lib I found out that when a player is dropped after a result is set, pairing may fail in subsequent rounds.

For example, after the code below executes, a round after will have not only wrong pairings, but it will pair the same player against himself sometimes. It's important to notice that this happens when recreating a tourney with reloadTournament and the type of tournament is "swiss".

const [match1] = tourney.activeMatches();
tourney.result(match1, 1, 1);

tourney.removePlayer(match1.playerTwo);

I'm still looking into replicating this problem right now. I can further explicate how we ended up in this problem, but it is quite a long (and visual) explanation.

slashinfty commented 2 years ago

As mentioned in #9 I'm working on v2, which includes a rewrite of the Swiss pairing algorithm. Obviously any detail you can provide would be helpful.

pedrohba1 commented 2 years ago

Do you have some spare time for us to explain the problem? Maybe it can help you on v2.

slashinfty commented 2 years ago

By all means! I'm modeling the v2 Swiss pairing algorithm more after the algorithm used for chess tournaments, in the ways that I can, so it should be better overall. But all information is helpful.

pedrohba1 commented 2 years ago

Can we talk on email? I think it actually should be easier if we make a call and we show it to you.

slashinfty commented 2 years ago

Would Discord work?

pedrohba1 commented 2 years ago

Sure!

slashinfty commented 2 years ago

slashinfty#6805

pedrohba1 commented 2 years ago

sent a request.