Round Robin Tournament Scheduling

C# Code for round-robin and double round-robin

skhurams · 5 · 13144

skhurams

  • Newbie
  • *
    • Posts: 2
on: March 09, 2013, 07:29:28 AM
Hi im working on football league website now I'm stuck in simple but complex module. I want to generate matches for leagues, knockout  and mix (leagues and knockout) and each may have single or home/away matches . Can any one help me ??


wbport

  • Senior Member
  • ****
    • Posts: 129
Reply #1 on: March 10, 2013, 07:20:02 AM
You don't need to reinvent the wheel.  ;)  There are many resources on this site you can check out and my own contribution is here--just download or click on view source to see how it works.  It's JavaScript so it should be easy to understand and/or transcribe.


skhurams

  • Newbie
  • *
    • Posts: 2
Reply #2 on: March 11, 2013, 06:04:43 AM
I was unable to find any resources regarding round robin and double round-robin and knockout tournament. The link you gave was in javascript and I was having problem converting your code to C#. Could you give any link specific to C# if any...


wbport

  • Senior Member
  • ****
    • Posts: 129
Reply #3 on: March 11, 2013, 08:19:28 AM
Found it on my old site: rrpair.c.  IMHO it would be worthwhile to study how the JavaScript version works than to use this old C program.  Other than the loss of pointers, I found it fairly easy to pick up JavaScript after a C background.

The site I gave in the first post has links to other pages showing how a RR works.  For a (for example) a 12 person (team) RR, player 12 sits on his own card table near the end of a loooong table where the rest of the chess sets are ready to go.  Assuming a "ribbon" of players (will have an odd number), 1 starts with White on 12's card table while the rest of the players are seated in order in every other position.  If done correctly, the pairings are 1-12, 11-2, 10-3, 9-4, etc.  With the exception of 12, add 1 to each player's current opponent to get the next one (1 follows 11).  When one's own number is reached, play 12 on the card table.

The color assignments (or home/away status) are fixed at every position except on the card table.  The player here is the ghost since he won't exist if there are an odd number of players.
« Last Edit: March 11, 2013, 08:37:16 AM by wbport »


Ian Wakeling

  • Forum Moderator
  • God Member
  • *****
    • Posts: 1140
Reply #4 on: March 11, 2013, 08:23:31 AM
There are also descriptions of simple algorithms that you could code.

The basic cyclic algorithm here. An enhancement to get court/field balance, an implementation of the latter in Excel VBA.

Knockout tournaments are fairly easy to schedule, so you may find it is best to start from scratch.