Tournaments Brckets Generating: Single Elimination
Overview
There are various elimination algorithm exist in the system:
1. Single Elimination
2. Double Elimination
3. Round Robin
4. Seeding etc
Here we will discuss only on Single Elimination scheme.
1. Single Elimination
2. Double Elimination
3. Round Robin
4. Seeding etc
Here we will discuss only on Single Elimination scheme.
Key Concepts

Figure 1. Single Elimination Graph
A single-elimination tournament — also called an Olympic system tournament, a knockout, cup, or sudden death tournament —
is a type of elimination tournament where the loser of each bracket is immediately eliminated from winning the championship
or first prize in the event.
is a type of elimination tournament where the loser of each bracket is immediately eliminated from winning the championship
or first prize in the event.
Formula
To calculate the number of rounds we need to consider the following:
int rounds = (int)Math.Log(Convert.ToInt32(txtNoofPlayers.Text), 2) + 1;
Where, txtNoofPlayers.Text providing the no of participants in a tournament.
No of player need to be power of 2 (i.e. 2, 4, 8, 16, 32, 128 etc)
After getting number of rounds, we can calculate number of matches should be occured on each round:
int noOfPlayers = Convert.ToInt32(txtNoofPlayers.Text);
#region calculating No of matches each round
for (int i = 1; i <= rounds; i++)
{
GroupMatches[i - 1] = noOfPlayers / 2;
noOfPlayers /= 2;
}
#endregion
int rounds = (int)Math.Log(Convert.ToInt32(txtNoofPlayers.Text), 2) + 1;
Where, txtNoofPlayers.Text providing the no of participants in a tournament.
No of player need to be power of 2 (i.e. 2, 4, 8, 16, 32, 128 etc)
After getting number of rounds, we can calculate number of matches should be occured on each round:
int noOfPlayers = Convert.ToInt32(txtNoofPlayers.Text);
#region calculating No of matches each round
for (int i = 1; i <= rounds; i++)
{
GroupMatches[i - 1] = noOfPlayers / 2;
noOfPlayers /= 2;
}
#endregion
By, Akash Roy, CEO, JPR Infoserve, http://jprinfoserve.com
No comments:
Post a Comment