Code works fine except...

John Yeung gallium.arsenide at gmail.com
Thu May 7 01:11:04 EDT 2009


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:

  http://en.wikipedia.org/wiki/Round-robin_tournament#Scheduling_algorithm

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.

John



More information about the Python-list mailing list