Complex pairing algorithm - team tournament

387 Views Asked by At

I would like to ask for help with an algorithm I’ve been working on for quite some time. I actually programmed it a few years ago using greedy pairing mostly but I’m not satisfied. Any help would be greatly appreciated!

So getting down to business. I have an application for tournament play (beachvolleyball to be precise, but should work for any pair-sport played in tournament format). The players show up on tournament day and gets randomly-ish put together with other participants and against other random teams. Top focus is to play as much as possible, however the number of players aren’t always divisible by the number of simultaneous playing spots. Therefor there will always be a number of players resting, standing the round out that is, and I’m trying to make sure this is as fair as possible by using 2 variables: Rests (total number of rests during the day) Rests in a row (Resting several games in a row, obviously)

The original concept of the tournament was mixing the teams with 1 male(m) and 1 female(f) in each team, playing against another team of m/f. However, the resting part is more important and there is often a lot more players of one sex than the other (i.e. 20 f and 7 m). Instead of letting the males play every single round, the program should make teams of f/f playing against f/f. Same-sex vs f/m should be avoided though. Players should get new partners every round and play against new teams every round. Preferably you should play with all players of the opposite sex before playing with someone again. Players are allowed to come and leave as they like, and also take a break at any time (voluntary rest).

I’ve looked into the unstable marriage problem and the roommate problem, but my problem seems to be a mix of the two. Normally there will be two lists of players (m/f) and pairing, but under certain premises there should be teams made from just one list as described. Let me give you an example:

EXAMPLE:

43 players show up for a tournament with 6 courts. 17 Females (f) and 26 Males (m).

The 6 courts fit 12 teams with a total of 24 players per round.

Round 1

*12 m - 12 f*

*19 resting (5f, 14m)*

Round 2

5f and 14m have 1 rest and should play.

The best solution would be:

*4 f - 4 m*

*1f - 1m*

*4m - 4m*

*1f - 1m* (these players played last round as well).

In this example there will normally not be more than 1 rests in a row, if there woud’ve been 49 players from the start on the other hand..

In future updates, I’m also planning on letting the user choose number of players per team, and also to skip the m/f requisite.

Any thoughts?

0

There are 0 best solutions below