This question relates directly to a dataset I've generated for Fantasy Premier League, but I'm also curious how I can apply this to a more general case.
Data
I have a list of premier league players, and for each player p I have calculated a predicted score s for that player over a period of time.
Each player inherently has a type t, ranging from 1-4, and a team m ranging from 1-20. Each player also has an inherent cost c.
Constraints
I can construct a team of consisting of 15 of these players. I am constrained by the number of players I can choose from each type t and team m such that, the team must have:
- 2 players of type t=1
- 5 players of type t=2
- 5 players of type t=3
- 3 players of type t=4
- no more than 3 players from any one team m
- a total cost sum(m) <= some budget value B
Problem
How can I create a team which maximises the sum of predicted scores sum(s) such that all constraints have been met. The brute force approach of generating every allowed team is not viable.