watxaut
watxaut

Reputation: 49

Create balanced tennis rounds

We are a group of 20 people and we like to go play 2 vs 2 tennis matches. Each of us plays one match each round and we do 5 rounds in total, so everyone plays 5 matches. Matches have two restrictions:

I managed to create a python script that does the specified above, but it takes about 20 minutes to finish depending on the level of the people :/. What I do is shuffle the list with every one in it, break it into 5 lists of 4 people, check if conditions are satisfied and repeat for every round.

I tried modeling the problem to solve it with linear programming (LP) but I don't know which is my function to optimize to begin with... Any ideas on how to do this with or without LP?

Thanks in advance!

Upvotes: 0

Views: 360

Answers (1)

Erwin Kalvelagen
Erwin Kalvelagen

Reputation: 16724

You could use a dummy objective or even try to minimize the max of the difference in levels.

My MIP model is not completely trivial, but it solves quite fast (about a second or so using a commercial solver).

enter image description here enter image description here

The results look ok at first sight:

enter image description here

I assumed two players cannot be in the same team more than once. I.e. not just in the same game. That is in my case you can play against another player more than once.

A more complex example can be found here.

Upvotes: 1

Related Questions