Round Robin Tournament Scheduling

Basketball Tournament Pools

cblaze22 · 2 · 6119

cblaze22

  • Junior Member
  • **
    • Posts: 33
on: August 14, 2011, 08:04:06 PM
I am trying to figure out an algorithm in C# on how to generate a schedule for each pool in a basketball tournament. I figured it out for 4 teams, but 6 is where I am having trouble with.  I am trying to do a first-fit with 6 teams.

If you check out this link https://www.devenezia.com/downloads/round-robin/rounds.php and go to first fit with 6 teams, that is what I am trying to accomplish.  But on round 2 I always get 5 playing 6 again because the second game is seeing 2 and 4.
« Last Edit: August 14, 2011, 08:04:40 PM by cblaze22 »


Richard

  • Newbie
  • *
    • Posts: 1
Reply #1 on: August 16, 2011, 04:46:37 PM
Quote
...But on round 2 I always get 5 playing 6 again because the second game is seeing 2 and 4.

Your first fit is probably going as such
1-2 3-4 5-6
1-3 2-4 5-6 at this point you have to eliminate 2-4 as a candidate because it leads to the reuse of a pair (5-6).  Back up and try the next pair after 2-4 which would be 2-5.
1-3 2-5 4-6 Voila!

The important step of backtracking is missing from your program.
Take a look at source and musings.