1

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?

saZmer
  • 118
  • 1
  • 8
  • 1
    If people can come and go whenever, then I think you are limited to planning the next set of 6 (or however many courts there are) games. Is that right? – j_random_hacker May 20 '17 at 19:25
  • 1
    I would choose a way to score each set of 6 simultaneous games, assigning, e.g., -20*i points for every player sitting out their ith game in a row, plus -5*j points for every player sitting out their jth total game, plus -3 points for every pair of players assigned to the same team who have already played together. Then use any simple heuristic (e.g. random assignments followed by hill-climbing (swapping players between teams, or between a team and "not playing"), run it a few thousand times, and pick the assignment with the best score. – j_random_hacker May 20 '17 at 19:33
  • 1
    I doubt it will be feasible to look for an exact solution, but fortunately that's not a particularly useful goal here anyway, since there's already a lot of uncertainty about the objective function (i.e., deciding which solutions are better than others). I would probably add a top-level loop that considers all possible sets of 6 match "types", where a type is M/M, M/F or F/F -- there are fewer that 3^6 of these (since order isn't important), which is very manageable. For each set of 6 types, you could then run the above hill-climbing algorithm, and pick the best as before. – j_random_hacker May 20 '17 at 19:36

0 Answers0