As for the algorithm, I tried using Google to find the solution but still can't (((
✅ v0.1 - Here are the basic requirements:
Input variables:
- Total time to play (e.g. 120 mins)
- Number of players with their names (e.g. 13)
- Number of teams (e.g 2) - for now only consider 2 teams, and don't design application for other cases
- Players per team (e.g. 5)
Output results:
- Optimal amount of time between "switches", so that everybody plays ~ the same amount of total time.
- Roaster of 2 teams for each of the "switches"
- Each player shall play with as many people in his team as possible - "player rotation"
Use case:
- User inputs the variables in a form of table, for example
- User gets roaster of each "switch", including player names on each team
- Some debug information may be presented:
- Optimal amount of time between "switches"
- Number of minutes every player plays (calculated based on formed roaster)
- Matrix of each player (x-axis) to each player (y-axis), where the intersection shows amount of minutes that each player plays with another player on the same team
Example :
Switch 1 - min 0-7:
Player A | Player F |
---|---|
Player B | Player G |
Player C | Player H |
Player D | Player I |
Player E | Player J |
Switch 2 - min 7-14:
Player K | Player F |
---|---|
Player L | Player G |
Player C | Player H |
Player D | Player A |
Player E | Player B |
…
————
✅ v0.2 - Goalkeeper changes
Based on v.0.1 input variables form:
- Roaster of goalkeepers with timestamps on each team
————
✅ v0.3 - Players ranking affects roaster formation
Introduce new input variables:
- For each player - ranking shall be introduced
- scale: 1,2,3,4,5
Output:
- Players ranking affects roaster formation so that each team is "balanced" - total amount of "ranking points" between teams deviates as little as possible (e.g. 23<->22)
————
✅ v0.4 - Players role affects roaster
Introduce new input variables:
- For each player - position
- possible values: attack, middle, defense
Output:
- Players role affects roaster formation so that each team is "balanced" - each team has ~ equal amount of attackers, midfielders & defenders