I need to produce a formula that takes the following parameters:
- T = time of game in minutes
- p = number of players on field at one time
- s = number of substitute players
Each of these is variable on a game-to-game basis but once the game has begun they remain constant.
The goal is to ensure that each player receives an equal number of minutes on the field during the game. There is no limit on the amount of changes that can be made from substitutes (s) onto the field (p) and a player that has left the field can return later as a substitute.
The simple solution to this problem is to swap the players with the least playing time onto the field every T/(p+s) minutes. However, this often results in making changes more regularly than is necessary. Ideally, this task should be achieved with the minimum number of changes to reduce stoppages in play.
There is a very good example of the result on the internet at http://soccerslava.com/fcalc/en/fcalc.php, however I need to be able to run these calculations offline, hence needing the formula.
I'm hoping that this must be easier than it appears to be!