Click here to Skip to main content
11,796,631 members (73,218 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: Algorithms
I am looking for an algorithm which can determine a schedule of games to be played given the following parameters.

- There are 12 teams in the league
- There are 4 venues
- Every Wednesday for 11 weeks, each team plays 2 other teams at one of the specified venues; thus each team will play 22 matches in the season
- Every team must play every other team exactly twice throughout the season

Essentially, you just need to group the teams in blocks of 3 each week such that they only appear in the same group as another team twice in the season.

Here would be an example of the first couple weeks:

Week 1: Venue A: 1,2,3; Venue B: 4,5,6; Venue C: 7,8,9; Venue D: 10, 11, 12
Week 2: Venue A: 1,5,9; Venue B: 2,6,10; Venue C: 3,7,11; Venue D: 4, 8, 12
Week 11: ?

Testing all the combinations is obviously not feasible. Any help would be greatly appreciated.
Posted 8-Mar-13 2:56am
Edited 8-Mar-13 3:50am
Mike Meinz at 8-Mar-13 9:29am
Do you mean "Round Robin"?
MichaelBergsma at 8-Mar-13 9:50am
Yes, yes I do.
Sandeep Mewara at 8-Mar-13 11:06am
What are your thoughts? Tried anything so far?
MichaelBergsma at 8-Mar-13 11:54am
I read througth and tried a modified version of the diagonal scheme but since I need teams to be group in three instead of 2, it makes it more difficult.
MichaelBergsma at 8-Mar-13 13:02pm
I didn't realize what a can of worms this was.'s_schoolgirl_problem

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 505
1 Abhinav S 417
2 OriginalGriff 360
3 CPallini 285
4 KrunalRohit 249
0 OriginalGriff 2,012
1 Maciej Los 1,725
2 KrunalRohit 1,310
3 CPallini 1,055
4 ppolymorphe 858

Advertise | Privacy | Mobile
Web01 | 2.8.151002.1 | Last Updated 8 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100