Hi all,

I've been working on this problem on and off for a few years now and I'm completely stuck. I'm not even sure if what I want to do is even possible but I thought I'd give it a shot here.

Every year I host a "King of the Beach" volleyball tournament. For anyone who doesn't know, it's a tournament where teams of 2 play against other teams of 2 but the teams change every round. As a player, you never play with the same partner twice and ideally, you're limited in the number of times you play against another player. So for example if you had 4 players, the first game would be A and B vs C and D, the second game would be A and C vs B and D and so on....

I've found a few sites online that will create a tournament like that for me if I enter the number of players but none of them have the parameters that I need. They all just create random pairings and have everyone play with everyone else once no matter how long it takes. One of the problems I have is that it's volleyball so we have limited time and limited energy so even if I have 200 players, I need the number of games each player plays limited to 7-9 games.

So here's what I'm trying to do:

I want to rank each player by skill level. The best player being #1, second best #2 etc....

I want every game to be as evenly matched numerically as possible so everyone has an equal chance to win no matter how good they are. So if Player 2 and Player 5 are on a team, their team "value" is 7 so I want them to play a team with an equal value or as close as possible ie Player 1 and Player 6 or Player 3 and Player 4.

I need to limit the number of games each player plays to a minimum of 7 and a maximum of 9

No player can play with the same player twice and I would like to limit the number of times a player plays against the same opponent as much as possible (ideally no more than twice but I can't seem to avoid 3 on occasion)

We're limited to 3 courts per gender (we have a male and female division) so once the teams and matchups are created, I need to assign them courts. But obviously, players can't be in 2 places at once so I need the matches grouped into groups of 3 where no numbers repeat (this has proven to be the hardest part)

I've been slowly working through this manually. It's extremely painstaking. The reason I'm here is because I would like to know if there's a formula to figure all of this out because the final variable, is that because we do this on a group vacation and plans constantly evolve, I never know the number of players in each gender until the morning of the tournament. So I've been manually creating tournaments for every possible number of players starting with 8 and trying to work up to 16. 16 is about the max I could accommodate because of the 3 nets. You'd have 12 players playing (4 on each court) and 4 players sitting each round. If 15 people show up, we have 12 playing and 3 sitting each round etc....

Like I said, I've been working on this for almost 2 years now and I'm pulling my hair out. I want to have a formula or spreadsheet or whatever where I can take the number of players that show up (it will most definitely fall between 8 and 16 but I'd be interested to see if it could be done with way more for future use), plug that number in and get an evenly balanced schedule that fits on to no more than 3 courts where there are always 3 games going on.

Any help would be appreciated. I know this is pretty convoluted so please feel free to ask for any clarification on anything.

Thanks so much!