|
||||||||||||||||||||
Title: Floating Elimination, Polynomial Time Pairing Post by Janzert on Jan 12th, 2011, 10:38am After independently rediscovering the python module to do minimum weight perfect matching*, I now have some python scripts that will do folding elimination pairing in a reasonable time for any size tournament we will have in the foreseeable future. Here are the timings and average number of rounds from running 100 triple elimination tournaments of each size using Omar's tournament simulator: Code:
The code can found at https://bitbucket.org/janzert/folding-pairing/overview Currently there isn't any documentation, but simple_elim.py is a drop in replacement for doublep's pairing program and full_elim.py is a drop in for aaaa's program. I believe it will run under python 2.5 and could be easily modified for 2.4 if needed. Janzert * That aaaa discovered last year (http://arimaa.com/arimaa/forum/cgi/YaBB.cgi?board=events;action=display;num=1249655059;start=15#26), could have saved myself a good hour searching around google had I only gone and re-read that thread first :( |
||||||||||||||||||||
Title: Re: Floating Elimination, Polynomial Time Pairing Post by ocmiente on Jan 12th, 2011, 3:01pm Very nice! Now that I understand this a little better, I'm curious to know how you decide whether one set of weights or criteria is better than another. Do you optimize for average rating from best, percent of time that the highest rated wins, average number of rounds, some master formula that combines all of them, or do you just eyeball the results to get a sense of which is better? |
||||||||||||||||||||
Title: Re: Floating Elimination, Polynomial Time Pairing Post by Janzert on Jan 12th, 2011, 3:41pm The weights are derived from the tournament rules criteria for pairing (e.g. see the elimination section of this year's WC (http://arimaa.com/arimaa/wc/2011/rules.html) or CC (http://arimaa.com/arimaa/wcc/2011/rules.html)). Those criteria were derived from various conversations here over the last 5 years or so. The exact current criteria in use were proposed by Fritzlein a while back (there is a url to that thread in the source code of doublep's code but that url seems to have been broken with forum changes and I wasn't able to find it by searching either). Mostly they were built up over time to avoid pairings that were considered undesirable (repeated matchups, extra byes to one player, etc.) Janzert |
||||||||||||||||||||
Title: Re: Floating Elimination, Polynomial Time Pairing Post by aaaa on Jan 13th, 2011, 6:03pm I think that the current floating tuple elimination format with its hierarchy of strictly overruling priorities is pretty close to ideal, apart from the lopsided influence of seeding. To combat this, I'd first make giving a bye to a higher rated player a lower priority than avoiding match-ups between players with different number of losses. This would also lead to the hierarchy nicely following a regular pattern, where concerning one particular aspect (repetitions, number of losses and ratings), the corresponding rule with respect to assigning a bye would be directly followed by the one concerning pairing players. As for seeding, my proposal would be to do a reseeding each round based on the (Bradley-Terry) performance rating of each player in the tournament, adding a half-weighted draw against a virtual player that has the seeding rating of the player in question. I choose half a weight, so that each actual tournament game would have a stronger weight than the prior. An exception can be made for forfeited games, which, for the purpose of calculating performance ratings, can be considered not to have taken place at all. This approach would also help with getting rid of the unfortunate qualifying phase for bots. A round-robin phase should (apart from having the advantage of being able to be scheduled completely in advance) supply reasonably differentiating performance ratings for the FTE part, even with every participant starting with the same prior. |
||||||||||||||||||||
Title: Re: Floating Elimination, Polynomial Time Pairing Post by ocmiente on Jan 13th, 2011, 8:29pm I suspect that the outcome of the tournament doesn't change much with any reasonable changes in the pairing algorithms. From other (http://arimaa.com/arimaa/forum/cgi/YaBB.cgi?board=events;action=display;num=1249653915;start=75) threads (http://arimaa.com/arimaa/forum/cgi/YaBB.cgi?board=events;action=display;num=1290620477;start=112#112), comparing 4 different floating triple elimination approaches, the outcome looks about the same for each.
The simulations were run as follows: run4 'formats/XYZ' 2000 16 500 50 9999 run4 'formats/XYZ' 2000 16 500 200 9999 run4 'formats/XYZ' 2000 16 500 400 9999 The number in parenthesis after the format name is the average number of rounds the format requires. If it turns out that the complexity of the matching algorithm doesn't result in much difference in the result, then I would prefer to select the simplest approach. Something that might be done by hand would be ideal, so that players could more easily understand how they are matched. So I'm curious to know what numbers Janzert's latest format comes up with. If the percent or times player 1 wins is much higher than 35%, then we should spend more time fine tuning. |
||||||||||||||||||||
Title: Re: Floating Elimination, Polynomial Time Pairing Post by Janzert on Jan 14th, 2011, 1:46pm on 01/13/11 at 20:29:42, ocmiente wrote:
To be clear my implementation is not a new format. At least barring any bugs it should be the same pairing as the current floating elimination that is currently in use (also the same as doublep's (floatTripElimRepair) and aaaa's (floatTripeElimAaaa) code in the tournament simulator). It just uses a more efficient algorithm to find the best pairing. The past implementations using a branch and bound method were limited to around 20 players maximum. With this new algorithm pairing a 1000 players1 takes about 3 to 7 minutes while using roughly 250MB of memory. So it should make it practical to use floating elimination for just about any size tournament. Since I don't see the current floating triple elimination format numbers offhand, here's a couple of new runs:
Janzert 1 Output from simulationn for 1 tournament of 1000 players: Code:
2 Full output from triple elimination runs: Inaccuracy 50 Code:
Inaccuracy 200 Code:
Inaccuracy 400 Code:
|
||||||||||||||||||||
Title: Re: Floating Elimination, Polynomial Time Pairing Post by ocmiente on Jan 14th, 2011, 3:29pm Thanks very much for the explanation. I think I get it now and understand why the complex matching algorithm is a good way to go. I guess that the higher percentage of wins for player 1 in this format is due to the fact that it prefers to match stronger players with weaker players (while at the same time minimizing the win/loss difference between opponents for competitive reasons) in order to keep the stronger players around as long as possible. I think that I agree with aaaa that the influence of seeding seems lopsided. His recommendation seems like a good idea. Regarding the final parameter being 0 rather than 9999, you are right. I'm surprised that 9999 works at all, but running the simulations manually with 9999 gives plausible results. I'm going to rerun one of the 2000 tournament simulations to see if there is any difference, just because I'm curious. [EDIT] curiously, the results are about the same Code:
[END EDIT] Do you have any results for 2000 tournaments of 33 players? |
||||||||||||||||||||
Title: Re: Floating Elimination, Polynomial Time Pairing Post by Janzert on Jan 15th, 2011, 12:24am To keep with the power of 2s here are a few 32 player runs. First this one uses a little more realistic Elo spread of 1500 and inaccuracy of 200. Code:
And here are the more standard 500 spread and 50, 200, 400 inaccuracies: Code:
Code:
Code:
Janzert |
||||||||||||||||||||
Title: Re: Floating Elimination, Polynomial Time Pairing Post by omar on Jan 21st, 2011, 3:06pm I've been a bit behind on reading the forum; so I had not seen this till now. Wow, a 1000 player FTE. That's amazing. Regarding using 0 instead of 9999 for the draw parameter. It won't make any difference if your tournament state file is using 'pick' instead of 'pair'. aaaa, sorry I asked you to explain the advantages of your proposal in the 2012 WC format thread, but I see that you had already explained it here. Have you been able to implement this seeding method and compare it with our current FTE? Seeing as how robust FTE is to rating inaccuracy, I would guess that changing the seeding method won't make much difference. In fact even random seeding at each round would probably do just as well. |
||||||||||||||||||||
Title: Re: Floating Elimination, Polynomial Time Pairing Post by aaaa on Jan 28th, 2011, 6:06am To get an idea of how calculated ratings differ from the "real" ones, it is worth pointing out that the WHR system also comes with a method of calculating rating uncertainties for players. So it would be worth looking at what these numbers are for participants of a championship at the time of its start. It underscores, however, the fact that it makes more sense for the discrepancies to follow something like a normal rather than a uniform distribution in the simulations. It turns out that, given the randomness functionality provided by Boost, it's not so hard to create a generator for this under C++. As an executable, it could then simply be called by any script. |
||||||||||||||||||||
Title: Re: Floating Elimination, Polynomial Time Pairing Post by aaaa on Feb 23rd, 2011, 8:58pm Another dump of C++ code on the wiki, again totaling 3 files: perform.hpp contains code to calculate performance ratings. It's a separate file in order to allow it to be used in a different context; in particular, I'm thinking of a program that simply outputs values that indicate the relative performance of the players. fte2.cpp is the new floating tuple elimination scheduler, but it requires (besides, obviously, the already uploaded colors.hpp) the use of a maximum weighted matching algorithm (which doesn't have to restrict solutions to those with maximum cardinality, although it is slightly preferable). match-py.cpp is one particular implementation of such an algorithm; it interfaces with the file mwmatching.py from http://www.xs4all.nl/~rjoris/maximummatching.html, which needs to be in the working directory when the scheduler is called. In addition, to compile it, one needs to have the Python library installed. To get an idea of how to get an executable, I at least, have to do something like the following (notice also the use of optimization flags): Code:
I had also created a similar interface to some very old C code (which, thus, would have eliminated any library dependency), but that doesn't appear to be able to handle the large weights that arise from having to enforce a strict priority of scheduling rules. The program expects at least five arguments:
Code:
|
||||||||||||||||||||
Title: Re: Floating Elimination, Polynomial Time Pairing Post by omar on Feb 23rd, 2011, 11:40pm Thanks for posting this aaaa. Will check it out after the events are over. Too many things going on right now. You have an account on the server, so feel free to upload it there and set it up. |
||||||||||||||||||||
Title: Re: Floating Elimination, Polynomial Time Pairing Post by Janzert on Mar 2nd, 2011, 1:00am aaaa, could the excess arguments come at the end instead of beginning of the argument list? Also even for tournaments where you want a randomized seeding, won't you want to do that external to the program so there can be a permanent record of the seeding? In which case the first argument can be eliminated. Janzert |
||||||||||||||||||||
Title: Re: Floating Elimination, Polynomial Time Pairing Post by aaaa on Mar 7th, 2011, 11:11am In case one just has to break a tie, which in our case is currently necessary to determine which bot will join the champion in the screening period, one useful technique could be to manually extend the tournament as follows: Continue to make use of the file containing all the games of the tournament, starting by explicitly eliminating everyone not in the running, i.e. the winner and, here, all those not amongst the losers with the most wins. Because that would normally eliminate everyone, the program will revive all not-explicitly-removed players, giving them each one more life (provided the number of lives supplied as argument is no more than the number used during the original course of the tournament plus one), and schedule pairings, still taking into account the earlier games of the tournament with respect to byes, pairings and performance ratings. If further rounds are necessary, then just continue to update the history file as normal. I would think that having the games of a main tournament affect the scheduling of a mini-tournament for runner-up in this fashion should actually be a desirable thing. |
||||||||||||||||||||
Title: Re: Floating Elimination, Polynomial Time Pairing Post by aaaa on Mar 26th, 2011, 8:47pm I have succeeded in converting the Python implementation of the algorithm to C++, thus removing the dependency on the Python library. The code is on the wiki as the article named mwmatching.cpp and obviously simply takes the place of match-py.cpp in the building process of the scheduler executable. |
||||||||||||||||||||
Title: Re: Floating Elimination, Polynomial Time Pairing Post by omar on Mar 28th, 2011, 1:59pm on 03/26/11 at 20:47:26, aaaa wrote:
Wow, that was a lot of coding aaaa. Thanks. I'll try compiling it all and will let you know if I run into any problems. |
||||||||||||||||||||
Arimaa Forum » Powered by YaBB 1 Gold - SP 1.3.1! YaBB © 2000-2003. All Rights Reserved. |