tournament-js/duel

question on algorithm subtleties

Closed this issue · 7 comments

Hi!

So, I've come across a strange thing and I was just curious why the algorithm works the way it does, basically.

I've been getting some feedback on OpenChallenge lately, and someone brought up an inconsistency between Duel and Challonge. For reference, here is Challonges bracket:

http://challonge.com/Smashatcujos

Here is the one generated by Duel:

http://seiyria.com/openchallenge/#!/tournaments/ZmFjZWJvb2s6MTAxNTM5NjYzMDU4MTgwMjk=/llama-test/-K0l9zL-LXJYbqkmAM-4

The concern was that there was a match played in the winner bracket (1-A, Duvy vs. Sheldo) that was replicated in the loser bracket (2-B). In Challonge, you can see that the two groups were split up so the same match didn't occur twice.

Is this intentional? Is there a way to make it so these duplicate matches don't happen?

Thanks!

clux commented

Hey, that's a nice observation. Match generation at the moment is pretty much entirely dependent on the seed order, and you could play around with moving those around, but ultimately it wouldn't really help you in this case.

It appears challonge is doing an extra permutation for LBR2 to drop on the second match instead of the first (which the current down algorithm forces). Need to have a better look at this. It's actually likely that this will generally result in less potential replays between players overall. If so, there should be a way in duel to handle it.

clux commented

Also openchallenge is starting to look pretty good! Nice work.

Thanks a ton! I've been digging in deep and putting tons of work into it. This was a great observation on behalf of one very observant user, and I'm glad to hear it makes sense!

clux commented

This was investigated and discussed in #11
The key thing is that this is a good way to limit replays, the original mode was designed to maintain seed balance (as in WBR1) so that each match in LB is equally tough (w.r.t. sum of seeds per match) if the seeding is perfect. I am not sure if the new mode is unambiguously better than the old one, but it's certainly worth having.

The option is available under the currently undocumented constructor option downMix: true.
It is available in duel@3.1.0 as a preliminary release, but I am still planning on doing some more testing this week.
It's there if you're keen to test it out though :)

Thanks for the suggestion.

Thanks! I'll likely wait until it's solid. I've got another project I'm working on currently so I'll get to this in a week or two.

Wanted to say that this works great! I gave it a go and it seems to work perfectly (at least, the case I'm looking at works correctly). Sorry it took so long, it's been a bit busy.

Thanks again!

clux commented

Good to hear. Yeah, I should be pretty good - the logic kind of forces everything to be consistent to be able to complete a tournament by scoring every match exactly once - and the tests do a lot of that.

I will add some more tests soon though just to be sure. Been busy doing other stuff. I'll notify this thread if anything changes, but don't really expect anything to at this point.