Pages

Wednesday 8 January 2014

Tournaments brackets Generating: Single Elimination

Tournaments Brckets Generating: Single Elimination

Download a dummy implementation of single elimination  


This guide presents the following sections to quickly get you up and running with the Single Elimination algorithms and implementations:

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.

Key Concepts

Single EliminationAdaptive Payments has operations that enable the sending and receiving of payments involving two or more parties. Each Adaptive Payments API transaction includes a sender and one or more receivers of the payment. Each transaction also includes the application owner, called the "API Caller," who is an invisible third party that provides the transaction flow and is the entity that makes the API calls. In most scenarios, payment transactions are initiated by the buyer (in asend type of payment arrangement) or by the seller (in a pay type of payment arrangement).

   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.

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
By,
Akash Roy,
CEO, JPR Infoserve,
http://jprinfoserve.com

No comments:

Post a Comment