Click to See Complete Forum and Search --> : Sports Draw


muzza
May 24th, 2008, 05:14 PM
Hi there,

I need an algorithm that can be coded in php/mysql to generate a sports draw from a list of sports teams.

Our starting point is that we have
·Several teams - each with a number indicating their seeding
·A number of rounds (sets of games) we want to generate draws for

Say we have 6 sports teams and want to generate 5 rounds - our required result is (something like)

Round Game 1 Game 2 Game 3
1 Seeding 1 and 6 Seeding 2 and 5 Seeding 3 and 4
2 Seeding 1 and 5 Seeding 2 and 3 Seeding 4 and 6
3 Seeding 1 and 4 Seeding 2 and 6 Seeding 3 and 5
4 Seeding 1 and 3 Seeding 2 and 4 Seeding 5 and 6
5 Seeding 1 and 2 Seeding 3 and 6 Seeding 4 and 5


What algorithm could achieve this for any number of teams and rounds (an odd number of teams won't exist because we will generate a "bye" team)?

Thanks in advance if anyone can assist.

Muzza