Smart Team Maker Algorithm
Create teams with nearly equal numbers of players, e.g. a team will never have 2 or more players than another team.
Spread players of the same skill level across teams, e.g. players with the same rating are distributed as evenly as possible.
Even female player distribution. Gender is considered independently from the player's skill rating.
Avoid concentrating either strong or weak players on one team. The goal is to create teams with a similar overall mix of skill levels.
Keep the total team ratings as close as possible. After considering the distribution of individual skill levels, the algorithm tries to minimize the difference in the teams' total ratings.
Consider the entire team composition. The algorithm evaluates the teams as a whole rather than making decisions based only on the next player being assigned.
Generate multiple possible combinations: Rather than producing a single arrangement, the algorithm evaluates 1,000 different team configurations to explore a wide range of potential combinations.
Maintain randomness. Among the 1,000 combinations that are similarly well balanced, the algorithm randomly selects one.