Play Cards Game Tournament Algorithm

51 Views Asked by At

I am currently trying to find algorithm to minimize the total time of a tournament.

The game requires $2$ teams of $2$ players in each team (total $4$ players).

Then, the perfect number of tournament players (to have $4$ players in the final game), must be $2^n$

However, it is very hard to always have registered players matching this perfect number. So, I can substitute computer players to complete the perfect number.

The number of sets of games to be played until the end is $n-1$

Each set of games will take in average $5-7$ minutes.

Lets have an example:

Registered players for tournament $ = 100$

Nearest perfect $2^n$ is $128=2^7$

Number of sets of games $n-1=6$

Total average time of tournament is $30-42$ minutes

I tried to split the $128$ players into $2$ tournaments and play simultaneously but there is no difference. Each tournament will have $25-35$ minutes ($64=2^6$ and number of sets is $5$) plus $5-7$ minutes for the final game of winners of two tournaments.

1

There are 1 best solutions below

0
On

You cannot reduce the time of the tournament. The constraints of your game seem to be the following: Exactly two teams play a game together and exactly one of the teams wins. Also I assume you want to find the best team in the following sense: Team A is better than team B iff A won against B or if there is team C such that A won against C and C is better than B. In other words: The "better-than" relation is the transitive closure of the "won-against" relation. (I assume here that the "better-than" relation defines a total order on the teams).

We can think of the teams as nodes in a graph G. If team A won against team B then we add a directed edge from A to B. Team A is now the winner of the tournament iff for every other team B there is a directed path from A to B. The minimum number of edges needed in order to be sure that A is the best team is thus $n-1$ if we have $n$ teams.

Your proposed algorithm:

We now construct a tournament where in every round some teams play against each other. In every round every team can only play one game. If we think about it, we realize that a loosing team cannot be the best team in the set of teams. So as soon as a team looses, we do not have to consider it anymore. We now want to find the best team by eliminating teams who loose. In order to do this as fast as possible, we have to eliminate as many teams as possible in every round. Assuming there are $2^k$ teams, we can eliminate at most half of them in the first round. Then half of the remaining in the second route etc. Thus we need $k$ rounds to eliminate all but one team.

This strategy is optimal: Let $n = 2^k$ the number of teams. Then we need at least $n-1 = 2^k - 1$ games (because that's the minimal number of edges we need) to determine the best team. In the first round we can at most play $2^{k-1}$ games. In the second round at most $2^{k-2}$ etc. This is because letting teams play who lost will not give us additional information. Now since $n-1 = \Sigma_{i=0}^{k-1}2^i$ we need at least $k$ round to get to the desired $n-1$ edges.