Code works fine except...
ross.jett at gmail.com
Fri May 8 02:32:22 CEST 2009
On May 7, 1:11 am, John Yeung <gallium.arsen... at gmail.com> wrote:
> On May 7, 12:30 am, Ross <ross.j... at gmail.com> wrote:
> > If I were to set up a dictionary that counted players used in the bye
> > list and only allowed players to be added to the bye list if they were
> > within 2 of the least used player, would this be a good approach for
> > managing bye selection or would using a dictionary in this manner be
> > unnecessary/redundant?
> I certainly have not proved it, but I think you don't need to resort
> to anything fancy if you are OK with the maximum byes being within two
> of the minimum byes. (Maybe this needs to be larger with larger
> numbers of players.) Try using your original shuffle but instead of
> selecting matches to "throw away" each week, just use the matches you
> need (to fill up the courts) and pick up where you left off the next
> week. For example, with 10 players, each "round" ideally consists of
> five matches. If you only have four courts, don't throw away the
> fifth match; save it as the first match next week.
> To be honest, I didn't look too carefully at your original shuffle.
> It may be good enough. It's a little different than the "standard"
> rotation as presented on Wikipedia:
> The one on Wikipedia happened to pass my casual tests with no more
> than a 2-bye difference between the most-played and least-played
> players, and didn't run into the problem of scheduling the same player
> for two matches the same week. But I have to stress I only tried a
> few starting values, which all worked; I didn't try to break it, or
> run an extensive battery of tests.
I really appreciate your help with this problem. Thanks to your
suggestions, I've managed to solve the problem. Here's what I did: I
used my original round_robin generator to generate each week. I then
took every week and chained them all together end to end. Then,
depending on how many courts are available, I can select that many
tuples at a time from the list. If you go in order, the discrepancy
between the player with the least amount of byes and the greatest
amount of byes is only 1. If you can make it exactly all the way
through a cycle, there will be no discrepancy. Anyways, I've done all
this by hand and it works so now I'm going to go ahead and code it up.
Again, thanks for your help.
More information about the Python-list