The tournament tag refers to any tournament style program. Only use when the question directly relates to programming tournament style programs.
Questions tagged [tournament]
112 questions
28
votes
11 answers
Tournament bracket placement algorithm
Given a list of opponent seeds (for example seeds 1 to 16), I'm trying to write an algorithm that will result in the top seed playing the lowest seed in that round, the 2nd seed playing the 2nd-lowest seed, etc.
Grouping 1 and 16, 2 and 15, etc.…

glen-84
- 1,778
- 2
- 18
- 30
9
votes
4 answers
Data structure for Double Elmination Tournament
I am in the process of converting my Tournament Organizer software, which allows the creation and manipulation of Double Elimination Tournaments, to use the MVVM design pattern so that it can be more easily tested. In doing so, I'm separating out…

FryGuy
- 8,614
- 3
- 33
- 47
8
votes
3 answers
Drawing a tournament bracket (CSS/HTML based on PHP Dataset)
If you're not familiar with what I mean by tournament bracket, see here:
http://baseballguru.com/bracket1.gif
That said, I have built the dataset and figured out the number of rounds (ceil(log($numPlayers,2))) and I am comfortable finding the number…

Matt Dunbar
- 950
- 3
- 11
- 21
5
votes
5 answers
Double-Elimination Tournament Schedule
I'm trying to create some logic to generate a schedule of events in a double-elimination tournament bracket.
Here is an example 8-team bracket:
rd1 quarter semi finals
A───┐
0 ├───────A┐
B───┘ │
4 ├────────A┐
C───┐ │…

jeffjenx
- 17,041
- 6
- 57
- 99
4
votes
1 answer
How do I write an efficient Pair Matching algorithm?
I need help with an algorithm that efficiently groups people into pairs, and ensures that previous pairs are not repeated.
For example, say we have 10 candidates;
candidates = [0,1,2,3,4,5,6,7,8,9]
And say we have a dictionary of previous matches…

Wolemercy
- 115
- 6
4
votes
1 answer
Algorithm for possible win in a tournament
I'm preparing for exam and I'm stuck with this problem:
We have n teams that play with each other twice. Each play ends without a draw. The team with the most wins is declared a winner (can be more than one). Design an algorithm that given some set…

xan
- 1,053
- 1
- 10
- 29
4
votes
4 answers
Remove redundant two way relationships in a Neo4j graph
I have a simple model of a chess tournament. It has 5 players playing each other. The graph looks like this:
The graph is generally fine, but upon further inspection, you can see that both sets
Guy1 vs Guy2,
and
Guy4 vs Guy5
have a redundant…

Monica Heddneck
- 2,973
- 10
- 55
- 89
4
votes
1 answer
Data structure for various tournament/competition types (league, ladder, single/double elimination etc.)
I'm attempting to build a system where users can easily create various types of tournaments and participate in them with other users. It's for no specific game, but instead a general purpose tool for viewing and updating tournament results from any…

user1463028
- 73
- 2
- 4
3
votes
1 answer
Finding the 3rd largest element in array of size (2^k +1) in n+2k-3 comparisons
"Find the 3rd largest element in array of size (2^k +1) in n+2k-3 comparisons."
This was a question I had in an Algorithms course final exam, which I didn't get all the points for. I'm stil not sure what is the correct answer after a thorough…

Itay R
- 35
- 8
3
votes
2 answers
How to populate a single tournament elimination randomly in PHP without repeat?
If i have this:
$players = array("A","B","C","D","E","F","G","H","I","J","L","M","N","O","P","Q");
How i populate a single tournament elimination like this for example:
Matche 1: AxL
Matche 2: CxJ
Matche 3: HxQ
.
.
.
Matche 8: ExP
16 players = 8…

FBN
- 185
- 1
- 1
- 11
3
votes
2 answers
What algorithm can generate Round-Robin "pairings" for rounds with more than two contestants?
I'd like to be able to generate a set of tournament match-ups such that each player faces each other player at least once, each player plays the same number of games. Think of it as an abstraction of round-robin matchups to Mario Kart.
In my case, I…

sehrgut
- 209
- 1
- 13
3
votes
3 answers
Double Elimination Tournament Algorithm for byes %4
I'm trying to code a Double Elimination tournament where the brackets are based on mod 4. The first round should handle all of the byes so that after round 2 there will be no more byes. I'm having a hard time trying to figure out the actual math…

user1044658
- 43
- 1
- 4
3
votes
1 answer
tournament selection
Im trying to implement a GA with tournament selection, but im a bit confused. I know first we select randomly k member from whole population. Then we choose the best one by using tournament size (lets say ts=2). Then we add the winner into the…

Who Cares
- 205
- 5
- 18
2
votes
1 answer
Optimizing brackets for a tournament
I'm building a system that will create a tournament based on a list of contenders.
Contenders have properties that might make them not able to be placed in brackets with eachother, such as gender, weight, skill level, etc.
In some cases this gets…

Bas
- 26,772
- 8
- 53
- 86
2
votes
1 answer
How to determinate round by element in tree (Tournament brackets)?
Assume we have following tree:
1
9
2
13
3
10
4
15
5
11
6
14
7
12
8
Where elements(matches):
1-8 is round 1
9-12 is round 2
13-14 is round 3
15 is round 4
How I can determinate round of element "n" in…

fozzy
- 25
- 4