I have a problem where I'm putting a tennis league together under certain constraints: Each week, each player must play against a unique opponent. In addition, in a doubles league, each player must have a unique partner each week. There are limited numbers of courts. For example, if 11 people sign up for a singles league where there are only 3 courts available, 5 people will have a bye each week. I need everybody in my leagues to have the same number of byes and I would ideally like their byes to be spaced out over the course of the league. I have written a round robin generator in python that rotates players opponents each week according to according to the following diagram:
1 2 -> 3 -> 4 / | 5 <- 6 <-7 <- 8 >From here, I am able to zip the pairs up into a list of tuples for each week. For example, the first week from the above diagram would produce a list like this [(1,5), (2,6), (3,7), (4,8)] and the second week would be [(1,6), (5,7), (2,8), (3,4)]. Unfortunately, since the first position remains fixed in this algorithm, I am unable to remove items from the list to account for court constraints/ bye weeks without having the first player always play or always have a bye week. Would you guys approach this problem differently? The problem gets even tougher for a doubles league. Thoughts and theories appreciated... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---