798657 wrote:
Interesting, I will take a look. Any particular suggestions? I'm also looking into combinaition algorithms.
I can calculate the point per dollar value and once I have ranked the players using this new value, I can try to use this to identify the ones that will give me the most points for a certain salary cap, however I'm still unsure how to find the best combinaition of players.
I'm no Genetic Algorithm expert but from what I've read it does not guarantee finding the best solution. It will find pretty good solutions, possibly the best, in a relatively short period of time.
For phase 1 maybe something like this:
Each team of 20 players has a way to calculate its max points for a given salary cap.
1. Create a bunch of random teams, for example 20 teams of 20 randomly selected players.
2. Sort the list of teams.
3. Take the top 4 teams and create child teams.
3a. Take the first 8-12 players (randomly choose between 8 and 12) from team 1 and match with the last 8-12 players from team 2, then team 3, then team 4, choosing enough of the last 8-12 to make a 20 player team.
3b. Repeat 3a for team 2 through team 4.
3c. Take the first 8-12 players from team 1 and add 8-12 randomly selected players. Do the same for the second 8-12 players from team 1.
3d. Repeat 3c for team 2 through team 4.
4. Repeat 2-4 many times, like a few hundred or until the same team ends up the best for many consecutiive interations.
For phase 2 you would have to make the reproduction algorithm more complex - make sure to take the right quantity of the type of player. You might also modify 3a and 3c. After you split the team it might work better to sort the players so the better players will appear first in the list. Or maybe just shuffle the list of 8-12 players. Otherwise, a lesser player might remain in the "gene pool" just because he happens to be first in the list of players.