Setting: Multiplayer team game.
Problem: Each player has a 1 to 5 star rating which is calculated based on their player stats. I was hoping to find an algorithm that assigns teams to these players in the fairest possible way.
There are two teams, with a maximum of 5 players per team.
Let’s say 6 players join the server. It would be desirable that the server assign the teams like this:
- 5 star player
- 3 star player
- 3 star player
VS
- 5 star player
- 4 star player
- 2 star player
..as opposed to this
- 5 star player
- 5 star player
- 4 star player
VS
- 3 star player
- 3 star player
- 2 star player
In the first example, there are a total of 11 stars per team, whereas in the second example, one team has a total 14 stars, while the other has 8.
Sorry I couldn’t be any more succinct.
Couldn’t you just average the scores of all the players, then pick the three for each team whose average score is closest to the average of all players?
You could select the correct players for each team by assigning the highest two players to separate teams, then average the permutations of the remaining four numbers and choose the one that most closely balances the teams.
I’m sure there would be a more logic-based solution for getting the last two members of each team as well.