1. Introduction
Tournament design is a combinatorial problem with many theoretical implications, as well as with a lot of practical applications. There are many types of tournaments that have been theoretically analyzed and practically used in various contexts. Basically, there are two main principles used in tournament design: “round-robin” principle and “knockout” principle. They can be used in isolation or combined for obtaining different tournaments designs, depending on various factors, such as the number of players, time available to carry out the tournament, and application domain.
In this paper we propose a formal definition of competitions that have the shape of single-elimination tournaments, also known as knockout tournaments. We introduce methods to quantitatively evaluate the attractiveness and competitiveness of a given tournament. We consider that a tournament is more attractive if competition is encouraged in higher stages, i.e., higher-ranked players will have the chance to meet in higher stages of the tournament, thus increasing the stake of their matches.
In knockout tournaments, the result of each match is always a win of one of the two players, i.e., draws are not possible. A knockout tournament is hierarchically structured as a binary tree such that each leaf represents one player or team that is enrolled in the tournament, while each internal node represents a game of the tournament.
The tournament is carried out in a series of rounds. If there is a number N of players equal to a power of 2, for example then the tournament tree is a complete binary tree with all the players entering the tournament in the first round; however, in the general case, the number of players might not be a power of 2, for example . In this case some of the players will receive waivers thus entering the tournament directly in the the second round, while the rest of the players will enter the tournament in the first round.
In this paper we significantly extend our preliminary results reported in [
1] for fully balanced tournaments (the number of players is
) to general tournaments where the number of players can be an arbitrary natural number, not necessarily a power of 2. Our new results are summarized as follows:
An exact formula for counting the total number of knockout tournaments in the general case, showing that the number of tournaments grows very large with the number of players.
A tournament cost function based on players’ quota that assigns a higher cost to those tournaments where highly ranked players tend to meet in higher stages, thus making the tournament more attractive and competitive.
An exact dynamic programming algorithm for computing optimal tournaments in the general case.
A more efficient generic sub-optimal algorithm derived from the idea of the dynamic programming approach.
Deterministic and stochastic versions of the generic sub-optimal algorithm.
The complexity analysis of all the proposed algorithms.
The implementation issues of the proposed algorithms using Python, as well as the experimental results obtained with our implementation.
2. Related Works
Tournament design attracted research in operations research, combinatorics, and statistics. The problem is also related to intelligent planning and activity scheduling, broadly covered also by artificial intelligence.
There are two main principles used in tournament design, namely the “round-robin” principle and “knockout” principle, and they can be used in isolation or combined for obtaining different tournaments designs. The “round-robin” principle states that in a tournament, each two players should meet at least once, sometimes exactly once. “Knockout”, also known as the “elimination” principle states that players are eliminated after a certain number of games, sometimes exactly after one game.
For example, in a round-robin tournament in which each two players should meet exactly once, an important aspect is the scheduling of the tournament, a problem also known as league scheduling [
2]. This is an important component of the tournament design. Note that the “round robin” principle can also be applied with restrictions. Consider for example a two-team tournament, in which each team has the same number of players. Each game involves two players from different teams and any two players from different teams must play exactly once. In this case, we can still apply the round-robin principle, but players of the same team are not allowed to play. This type of tournament is called a bipartite tournament. A good coverage of the combinatorial aspects of round-robin tournaments can be found in monograph [
2].
On the other hand, in a knockout tournament where two players will play at most one game and after each game exactly one player advances in the tournament, while the other is kicked off, the tournament schedule results directly from the tournament design, i.e., no separate scheduling stage is needed.
Note also that the round-robin and knock-out principles can be combined into a single tournament design. Consider for example the UEFA Champions League football tournament. In the groups’ phase, round-robin is used inside each group, while after the group phase, knockout is used to determine the tournament winner.
In this paper we consider knockout tournaments in which two players meet at most once. These are specialized tournaments with possible applications in sports (e.g., football and tennis tournaments), online games (e.g., online poker), and election processes. While in the former case there is a relatively low number of players, thus not raising special computational challenges, the number of players in massive multiplayer online games can grow such that computing the optimal tournament becomes a more difficult problem.
A comprehensive analysis of knockout tournaments is proposed in [
3,
4]. Traditionally, the method for designing a tournament involves two stages: (i) tournament structure design and (ii) seeding. In the first stage, the structure of the tournament tree is proposed. In the second stage, players are assigned to each leaf of the tournament tree; however, as we can argue that this method of tournament design has some limitations, we proposed different “integrated” approach. One limitation is for example the fact that once fixed, the tournament structure cannot be changed. On one hand this will result in a smaller search space during the seeding process, on the other hand it limits the total number of tournament designs. So our model of tournament trees includes both the tree structure, as well as the players’ seeding; a separate seeding process is not necessary.
Research in combinatorics of knockout tournaments also produced interesting mathematical results. The structure of a knockout tournament can be modeled as a special kind of binary tree, called an Otter tree [
5]. The number of knockout tournament structures (i.e., prior to seeding) for
N players is given by the Wedderburn—Etherington number [
6] of order
N that is known to have an exponential growth approximately equal to
.
An important aspect concerns the factors that can be used to evaluate a tournament design. This problem has been also considered in previous works [
3,
4]. An interesting discussion of economic aspects of tournament attractiveness, such as spectator interest, is provided by [
7].
A method for augmenting a tournament with probabilistic information based on tournament results was proposed in [
8]. The effectiveness of tournament plans based on dominance graphs is studied in [
6]. The tournament problem was also a source of inspiration for programming competitions [
9]. A more recent work addressing competitiveness development and ranking precision of tournaments is [
10].
For example, the more recent work [
3,
4] proposes a probabilistic approach to define the tournament cost, by including in their model the win–loss probabilities of each game between two players
i and
j. On one hand, we can question the robustness of such values. On the other hand, we recognize that some approximations of such values might be empirically obtained based on several factors, e.g., global player rankings (when available) or on the history of games between the players (if a nonempty history exists). In our work we do not use this information, i.e., we assume by default that there are equal winning chances for the players of each game. While this simplification clearly has drawbacks, it has the advantage of enabling a clean algorithm design based on dynamic programming principles. Our approach can be extended by adding probabilistic information to the cost function, but then it will require further analysis of algorithmic solutions within our “integrated” approach.
A theoretical investigation of knockout tournaments is provided by [
11]. Their analysis is focused only on tournaments with a power of 2 number of players, i.e., similar with [
1], but definitely less general than in the current work, where an arbitrary number of players is considered. Interesting results of this work concern the discussion of new seeding approaches named “equal gap” and “increasing competitive”, as well as the investigation of their theoretical properties.
There has been also theoretical interest in analyzing the possible outcomes of knockout tournaments. Upper and lower bounds of winning probabilities of players of a random knockout tournament are provided in [
12]. Note that the analysis is focused on the random knockout tournament where the definition of matches to be carried out in each round is defined randomly. Moreover, this work assumes as [
3,
4], that the win–loss probabilities of each match between two players are known.
There is also interest in the literature in designing new formats of knockout tournaments. For example, a new format based on actively involving the teams in defining the tournament format, was recently proposed in [
13] for the specific competition of UEFA Champions League. The proposed format was coined “Choose your opponent” with the claimed benefit to make group stages more exciting. The authors also show how this model can be used for the objective of maximizing the number of home games during the knockout stage.
Knockout tournament structures are sometimes called tournament brackets. According to [
14], two types of tournament brackets are possible: fixed and adaptive. In fixed brackets, the tournament structure is fixed, while in adaptive brackets pairings in stage
are defined based on winners of stage
i. Our approach is clearly fixed, with the difference that we use an integrated approach to define both the structure as well as the seeding. What is different in [
14] is the fact that authors look for optimizing a fixed bracket by using utility functions and Bayesian optimal design. They propose a simulated annealing algorithm to optimize the expected value of a given utility function on a fixed tournament bracket. While interesting, this endeavor is clearly different from our approach. We plan however to investigate in the future the suitability of extending integrated approach and proposed algorithms by incorporating probabilistic information.
Clearly tournaments have a lot of practical applications, for example in the sports’ domain. In this context, the recent work [
15] provides an interesting discussion on the economics of sports from operations research, as well as practical applicability perspectives. The discussion is centered around several paradoxes of tournament rankings, with clear examples from the practice of tournament design.
3. Knockout Tournaments
We consider hierarchically structured knockout tournaments such that the result of each match is always a win of one of the two players, i.e., draws are not possible. A tournament is modeled as a binary tree such that each leaf node represents a unique player and each internal node represents a game between two players and its winner.
Definition 1 (Tournaments). Let Σ be a finite nonempty set of players. We define the set of trees with leaves Σ as follows:
- 1.
If is a singleton set then , i.e., there is a single tree containing a single node i.
- 2.
If and are two disjoint sets of players then let . Then:
Note that the set notation in Equation (
1) implies that the trees are not ordered, i.e., the order of the left and right branches does not matter.
Example 1. We consider examples of tournaments for sets of players with and 4 elements:
- 1.
If then .
- 2.
If then .
- 3.
If then .
- 4.
If then . It is not difficult to see that in this case there are 15 trees.
Some of the tournaments introduced in Example 1 are depicted graphically in
Figure 1. Observe that the tournaments on the first row (labeled “a” and “b”) involve a number of elements that is a power of two (
and
, respectively) and are fully balanced. However, the tournaments on the second row are not fully balanced, although the lower rightmost tournament involves
players. However, intuitively, the tournament with three players (labeled “c”) should be accepted, as player 3 will enter the tournament only 1 round after players 1 and 2, i.e., it has a sense of “balancing”. However, the lower rightmost tournament with four players (labeled “d”) is not acceptable, as player 4 received an exemption from playing in the first two rounds, and this is considered unfair.
Proposition 1 (Counting tournaments). The set with players contains:
elements.
Proof. The number of full binary tree structures with
N leaves is equal to
where
is Catalan’s number [
16] defined by:
Now, each permutation of the
N players can be attached to the leaves of a binary tree, thus obtaining
trees. However, the branches of each internal node can be exchanged, resulting in the same tree. There are
internal nodes and therefore a total number of
exchanges, resulting a number of trees given by:
q.e.d. □
Example 2. For example, if we obtain trees, while if we obtain trees. These results are consistent with Example 1.
A valid tournament should be balanced, i.e., each player should play (almost) the same number of games to win the tournament.
Analyzing the tournaments from Example 1 and
Figure 1 we can observe that if
then each element of
represents a valid tournament. However, if
then only 3 trees of
represent valid tournaments. For example,
is a valid tournament as each player should play exactly two games to win the tournament. In this case we have a fully balanced tournament consisting of
players. Moreover,
is also considered a valid tournament, as players 1 and 2 must play two games to win, while player 3 must play one game to win, i.e., has an exemption for the first round (the difference between the number of games played by each player is at most 1). However,
is not a valid tournament, as players 1 and 2 must play three games to win the tournament, while player 4 must play a single match to win the tournament (the difference between the number of games played by each player is above 1, i.e., more than one exemption for a player is considered unfair).
Observe that a tree representing a valid tournament has the property that all its leaves are of height n or for a suitable value of n. Actually, the value of n can be determined from the given number of players N of the tournament and it represents the number of rounds of the tournament.
Let us consider a tournament with
n rounds. It is not difficult to see that the maximum number of players is
and it is obtained when in the first round we have a maximum number of
games; therefore, for a tournament with
n rounds we have:
Observe that from Equation (
5) it follows that:
Definition 2 (Balanced (valid) tournaments).
Let be the number of rounds. Let Σ
be a nonempty set of N players such that conditions (5) and (6) are fulfilled. Then the set of balanced trees with n layers representing the set of balanced (valid) tournaments with n rounds is defined as follows: - 1.
If then so we have a singleton set . In this case .
- 2.
If , , , and then .
- 3.
If , , is a fully balanced tree (i.e., ), and then .
If then there are players. Then a tree can be obtained either (i) by joining two balanced trees with layers or (ii) by joining one balanced tree with layers and one fully balanced tree with layers (all its leaves are on layer ), so in both cases the balancing condition of t is properly preserved.
Proposition 2 (Structure of a balanced tournament).
Let be a tournament of N players such that n is defined by Equation (6). Then the number of players starting in the first round is and the number of players starting in the second round (waivers) is . Moreover, if then the number of internal nodes of level 2
in the tree is equal to , i.e., and . Proof. First observe that if the number of players is a power of 2, i.e., , then , , and . This is trivially true, as in this case the tournament is fully balanced and all the players start in the first round (there are no exemptions).
The proof for the general case can be shown by induction on .
For the tournament has players. In this case there is a single balanced tournament with and , so the property trivially holds.
For the tournament has players. In this case there is a single balanced tournament with , and , so the property trivially holds.
Let us now assume that the property holds for and let us prove it for . There are two cases.
Case 1. If , , , and , let us consider such that the second condition of Definition 2 is fulfilled. According to the induction hypothesis we have , , for and . Then . Similarly and q.e.d.
Case 2. If , , is a fully balanced tree (i.e., ), and , let us consider such that the third condition of Definition 2 is fulfilled. According to the induction hypothesis we have , , , , and , , and . Then . Similarly and similarly for q.e.d.
The relations and can be now easily checked. □
Example 3 (Tournament structure design).
Let us consider a tournament with players. In this case , , , . A tree representing a tournament with five players will have three layers such that the first layer consists of leaves (players) and the second layer consists of nodes among which there is internal node and leaves (players). One such a balanced tournament is depicted in Figure 2. Proposition 3 (Counting balanced tournaments).
The set with players contains:elements.
Proof. There are
ways of choosing how the
players will enter second round. Their ordering matters so we multiply with
. Moreover those
players are arbitrarily chosen from the set of
N players, so we multiply with
. Finally, the ordering of those
remaining players that enter first round matters, so we also multiply with
. For each internal node of the tree, exchanging its left and right sub-tree is a tournament invariant. There are
independent ways of exchanging left and right sub-tree of the tree, so we must divide by
. We obtain:
A simpler proof is obtained by thinking about structures (i.e., “shapes”) of tournament trees. The selection of the “locations” of those
players entering second round can be achieved in
ways. For each tree structure defined in this way there are
permutations of the leaves (players), thus defining a total number of
balanced tournament trees. Finally we divide by
and we obtain Equation (
7). □
Example 4. Let us check the number of balanced tournaments for several cases.
- 1.
The number of balanced tournaments with players can be obtained as follows: It is not difficult to verify that this result is correct. In this case . There are ways of selecting those two players that will enter first round. We have one separate tournament by letting the winner of the game of these two players playing against each of the remaining three players in the second round. So in total there are balanced tournaments with five players.
- 2.
For players we obtain: - 3.
If then , thus we obtain our result for fully balanced tournaments from [1] stating that the total number of fully balanced tournaments is given by: The number of fully balanced tournaments with two rounds is . Observe that applying the formula, we obtain 315 fully balanced tournaments with three rounds. Let us obtain this result using a different reasoning. Let us count the number of a set with eight elements consisting of two subsets of four elements each. There are possibilities, as we consider the four combinations of eight elements, and we divide by two as the order of the subsets of a partition does not matter; however, for each set of each partition there are three fully balanced tournaments of three rounds, so multiplying we obtain a total of nine possibilities. So the number of three-stage tournaments is .
4. Optimal Tournaments
Each round of a tournament with
n rounds defines possible games between players. Note that in a given tournament any two players can play in a game at one and only one of its rounds. This follows from the fact that for any two leaves of a binary tree there is a unique closest common ancestor. It follows that the tournament round
where players
can meet is a unique value in
and it is well defined. For example, referring to the tournament shown in
Figure 2,
,
, and
.
Intuitively, the higher the quotations of players i and j, the better it is to let them meet in a higher stage of the tournament in order to increase the stakes of their games.
We assume in what follows that a quotation is available for each player . Quotations can be obtained from the players’ current ranking (as for example in international tennis tournaments ATP and WTA) or by other means.
Definition 3 (Tournament cost).
Let be a tournament with n rounds and let be the stage of t where players can meet. Let be the quotations of players for all . The cost of t is defined as: Definition 4 (Optimal tournament).
A tournament such that its cost computed with Equation (12) is maximal is called an optimal tournament
and it is defined by: Obviously, better ranked players have a higher quotation. We assume that if player i has rank then its quota is such that whenever we have . For example, if there are players then we can choose for all .
Example 5. Let us consider the tournaments , , and with three players shown in Figure 3. Let us introduce: The ordering of the costs depends on the ordering of the values of the function for . This function is monotonically increasing on and monotonically decreasing on . Observe that if , i.e., if neither player gets more than a half of the total quotation stake, then the ordering of the costs is given by the ordering of the quotations .
Example 6. Let us consider four players (see Table 1). We assume that each player has a unique rank from 1 to 4. Now, if we choose then, using this approach for defining players’ quota, player 2 with rank 4 is assigned quotation . We consider the three tournaments from Figure 4. According to Equation (12), the cost of a tournament is: Substituting stage values for each tournament from Table 2 into Equation (16) we obtain the tournaments’ cost values from Table 2. We observe that in this case the best tournament is . Actually it can be easily checked that the best tournament is for whatever values of the quota that are decreasingly ordered according to the ranks. 6. Implementation and Experiments
6.1. Implementation Issues
There were several issues that we had to address by our experimental implementation of Algorithms 1–3.
Firstly, we have chosen to represent sets as arrays of bits, as well as using the integer value that is equivalent to the binary representation as an array of bits.
Secondly, for generating subsets of given size (i.e., combinations) we have used Algorithm 7.2.1.2L from [
19] for generating permutations with repetitions of binary arrays. Basically the subsets representing combinations of
k elements of a set with
elements are all the permutations with repetitions of a binary vector of
n elements containing exactly
k elements equal to 1.
Thirdly, we had to choose an efficient representation of and structures. Their operation is crucial for the efficient implementation of some of our algorithms. As for our implementation we have chosen Python platform, we decided to implement and using subset-indexed dictionaries that map subsets of to costs and to subsets necessary for building optimal tournaments, respectively. The subsets representing the dictionary keys are defined as integer values of their characteristic vector in binary format. As Python dictionaries are efficiently implemented using hash tables, an average time complexity is expected for lookup operations.
Finally, for the implementation of the random selection of subsets we have used the array of bits representation of sets and we have applied the random.permute function from NumPy package to return a randomly permuted array representing a random subset.
6.2. Experimental Results
Our experiments were developed in Python 3.7.3 using Jupyter Notebook on an
x64-based PC with a 2 cores/4 threads Intel© Core™i7-5500U CPU at 2.40 GHz running Windows 10 (The experimental code is available at
http://software.ucv.ro/~cbadica/tour.zip accessed on 2 September 2021).
According to our findings, there are no algorithms directly available to be compared with our own proposals. There are two main causes for this. First, we consider an integrated approach of tournament design, rather than a process involving two separated stages for structure design and seeding. Secondly, we do not use probabilistic information in our cost function, thus hindering the direct comparison of tournament cost values.
We took a different path for evaluating our proposals. We have implemented optimal algorithms, as well as several versions of sub-optimal algorithms and then compared their outcomes in terms of running time and optimality. So finally we have implemented and experimentally evaluated eight algorithms, as presented in
Table 4.
Note that for the optimal algorithms there are at least two restrictions that hinder a complete experimental comparison with the rest of the algorithms. Firstly, their high computational complexity limits their applicability only to small number of players. Secondly, the dynamic programming bottom-up algorithm works only for a number of players that is an exact power of 2. We have only checked it for .
Our data set includes multiple sequences of players’ quotations. For each
we generated a sequence of quotations
with integer values
randomly chosen with a uniform distribution in the interval
. This data set was used to experimentally evaluate the algorithms from
Table 4, as follows:
All the sequences of the data set were used for testing algorithms and for .
The optimal algorithm was evaluated only for sequences corresponding to players. The reason is that the algorithm has a too high computational complexity and we limited the running time of each problem instance to 5 min.
The optimal algorithm was evaluated only for sequences corresponding to players. The reason is both the high computational complexity of the algorithm and the fact that this algorithm was designed to work only with a number of players that is an exact power of 2.
For each algorithm, we recorded the (sub-)optimal cost of the output tournament, as well as the running time. Stochastic algorithms for were evaluated by repeating their execution 10 times for each input sequence of quotations from the data set and recording the minimum, maximum, and average costs, as well as the average running times.
Figure 5 presents the sub-optimal costs produced by
and
algorithms for
. The figure plots costs
produced by algorithms
for
, as well as average costs
produced by algorithms
for
and the maximum cost
produced by the 10-times repeated execution of algorithm
. Note that we included maximum cost only for this case, as it should be obvious that it is expected that stochastic algorithm
will produce the best results among
for
because it uses the highest number of samplings
.
Analyzing
Figure 5, we first observe that the relative difference of the costs produced by the various algorithms on the same input sequence is rather low. This is expected, as quotations
were generated as integer values from a small interval
while the cost tends to reach significantly higher values. For example, analyzing in detail the results obtained for the sample with
players we observe that the relative difference between the smallest and the highest cost obtained (147,555 and 156,203) is of only
. We can also notice that the best results among sub-optimal algorithms were obtained by algorithm
, while the worst results were obtained by algorithms
and
. It might look a bit surprising that algorithm
appears to be superior to
and
; however, taking into account how the data set was generated, this could be explained by the fact that algorithm
is actually using a random permutation of the quotations’ sequence that provides a better balance of the total quotation distribution between the two subsets
and
(see Algorithm 4) than algorithms
and
. One final remark, also observed experimentally, is that algorithms
and
produce the same sub-optimal costs if the number of players is an exact power of 2 (i.e., 16 and 32 on
Figure 5). This is an immediate consequence on the logic behind their strategy definition.
Figure 6 presents the running times
and
of algorithms
and
for
. The time figures are given in milliseconds and presented on a logarithmic scale and they were computed by taking the average for 10 executions of the algorithm on the same input data. First observe that deterministic versions
are the fastest and they have virtually almost the same running times. This can be easily explained by the low computational complexity of the implementation of their underlying strategies. Basically, their strategies use the same mechanism, while the additional sorting of the sequence of quotations adds a negligible cost as it is performed before the actual core processing of the algorithms. Second, the highest execution time is achieved, as expected, by
. This algorithm has the highest computational complexity among sub-optimal algorithms, as it is using three subset samples during the top-down search. From
Figure 6 it also follows that the highest average execution time was obtained for the sequence of quotations with
players and its value was
s.
Figure 7 presents results obtained with optimal algorithms
and
, as well as their comparison with results obtained by sub-optimal algorithm
for
players, on our input data set.
In
Figure 7a we show the comparison of relative maximum and average costs obtained by algorithm
(
and
) with the actual optimal cost obtained by algorithm
. The relative sub-optimal cost is a measure
computed with Equation (
42) using the absolute values of sub-optimal cost
and optimal cost
. Observe that
if and only if
, i.e., if the algorithm providing sub-optimal cost
is in fact optimal. Note that the computation of the relative sub-optimal cost assumes the the exact value
of the optimal cost is known. In our case, this value is known, as it was determined using the
optimal algorithm for
players.
In
Figure 7b we show the comparison of running times
,
, and
of algorithms
,
, and
for
players. The running times were evaluated by repeating the algorithm execution 10 times for the same input data. They are plotted on a logarithmic scale. Observe that by far the most efficient among them is algorithm
. The linear increasing trend of
and
on the logarithmic scale is consistent to our findings that the complexity of algorithms
and
is exponential with the number of tournament players. Note that this tendency is also observed on the plot of
, for which the values were recorded only for an exact power of two of the number of players, i.e.,
. Moreover, the sub-linear increasing trend of
on the logarithmic scale is consistent with the fact that algorithm
has a polynomial time complexity.