Helpful Information
 
 
Category: Software Design
Tournaments / Leagues

I've been searching for a few months to find the correct formulas that I can translate into PHP/store in MySQL to do tournament brackets and leagues. Round-Robin, Single/Double Elim, playoffs, qualifiers, etc.

The closest thing I could find was this:
http://www.info.univ-angers.fr/pub/hao/papers/ECAI00WS.pdf
which, frankly, I can't wrap my head around.

Any ideas, hints, or other resources?

I've been searching for a few months to find the correct formulas that I can translate into PHP/store in MySQL to do tournament brackets and leagues. Round-Robin, Single/Double Elim, playoffs, qualifiers, etc.

The closest thing I could find was this:
http://www.info.univ-angers.fr/pub/hao/papers/ECAI00WS.pdf
which, frankly, I can't wrap my head around.

Any ideas, hints, or other resources?

Several years later, and I still have yet to find anything more useful.

That's a pretty general question but maybe you're looking for things like this?

round robin (http://forums.devshed.com/showpost.php?p=1741059&postcount=5)

Obviously a simple example, but maybe that will help you out? If you need to factor in things like location and home/away games, obviously it gets more complicated.

I don't know if this is the kind of stuff you're looking for, but there are certain mathematics to single elimination tournaments as long as you know the number of teams.



$numRounds = ceil ( log10 ( $numTeams ) / log10 ( 2 ) ) ;
// number of teams beginning a particular round
$numTeamsBegin = pow ( 2 , $numRounds - $roundNum + 1 ) ;
// number of teams advancing after a particular round
$numTeamsEnd = pow ( 2 , $numRounds - $roundNum ) ;
//or
$numTeamsEnd = $numTeamsBegin / 2 ;


A double elimination tournament is like two single elimination tournaments linked together. The only difference is the losers bracket has a 'hiccup' each round because the winners from the losers brackets have to play the losers from the winners brackets before the losers brackets makes any progress. The number of rounds in the losers bracket can be found by



$numRounds = ceil ( log10 ( $numTeams / 2 ) / log10 ( 2 ) ) * 2 ;


The xth round of the losers bracket will have the same number of teams as the ( ceil(x/2) )th round in the winners bracket.

etc, etc.. there are more, but I don't know if this is at all helpful to what you are looking for. If you're just looking to create the brackets (or simulate one), those numbers are all you need and you can make loops that go round by round (twice as quickly in the losers bracket).










privacy (GDPR)