View Full Version : Calculating fixtures
charlgerber
20 Aug 2002, 04:42 AM
Can someone please provide me with a good algorythm for calculating league fixtures? I know Ken Butler used to have a good one that could be applied to a league of any number of teams.... anyone out there? Thanks!
IASocFan
20 Aug 2002, 08:42 AM
Say you have 8 teams. Start with
1-2
3-4
5-6
7-8.
Then keep 1 stationary and rotate the rest:
1-3
5-2
7-4
8-6
week 3
1-5
7-3
8-2
6-4
etc. for weeks 4-7. This works for any number of teams. If you have an odd number, one number becomes the bye team. Hope this was what you were looking for.
IASocFan
20 Aug 2002, 08:55 AM
My objective was to provide a round robin schedule for a given number of teams. The teams are placed randomly. I'm not sure what you're trying to accomplish.
charlgerber
20 Aug 2002, 08:56 AM
Thanks, this is a big help... I just need to tweak the algorythm a bit to ensure teams play home/away in alternate weeks. Is this the algorythm based on th graph theory?
charlgerber
20 Aug 2002, 08:59 AM
Sorry, I initially misunderstood what you meant by rotating, but then I see you physically rotated them clockwise, ignoring 1.... it is now clear. Thanks again.
IASocFan
20 Aug 2002, 09:01 AM
Originally posted by charlgerber
Is this the algorythm based on th graph theory?
I don't think so.
Dr. Wankler
20 Aug 2002, 11:12 AM
It was my understanding that there would be no math required for membership on bigsoccer.
charlgerber
21 Aug 2002, 04:49 AM
I wrote a Java program (with some tweaks) and this works very well. You should see the code - now that is a mathematical nightmare at first glance! But the result is great. The tweaks I made was alternating the home/away teams every second week, so now you get a "real" schedule with teams playing every 2nd game home/away. Only once in the season will a team play two consecutive home games and two consecutive away games.
But I'm also still looking for the other algorythm to compare the two.....
IASocFan
21 Aug 2002, 07:57 AM
does your proram work with any number of teams?
charlgerber
21 Aug 2002, 08:10 AM
I've tested it for 4,6,8,10 and 18 teams and it worked fine. I haven't checked for uneven numbers, but I am using it for specificly 18 teams, so my problem is solved.
I'll write JUnit test code to test the fixtures thoroughly for all sorts of criteria.