My favorite kind of question :)
Here is the model setup:
- Top table shows the decision variables:
= 1
if playeri = A, B, ..., N
of listL = QB, .., TE
is selected,=0
otherwise. - Entries in column
R
, (next to the top table) are the sums of each row. These must be constrained with the numbers in columnT
. CellR7
is the total sum of players, which should be 9: 2 flexible and 7 as per the individual list requirements. - Middle table shows the salaries (randomly generated between 50,000 and 150,000). The
Sum of Salaries
formula is=SUMPRODUCT(C11:P14,C3:P6)
. The idea here is that only the salaries of players that are selected are taken into account. ThisSUMPRODUCT
should be constrained with the budget, which is in cellT14
. For my experiment, I put it equal to80%
of the total sum of all salaries. - Objective: Bottom table shows the projected points for each player. The formula in cell
R22
is=SUMPRODUCT(C19:P22,C3:P6)
(same logic as with salaries above). This is the value to be maximized.
Solver Model shown below:
I suggest selecting Simplex LP
and going to Options
and setting the Integer Optimality
to zero (0).
Result:
Solver manages to find an optimal solution. The problem is really small and it is very quick. Solver works with up to 200 variables and 100 constraints, for large problems you will need the (commercial) extended version:
Of course, you can just order the real player names so that they fit this setting. For example, if you sort the players of each list alphabetically, then (Player A, QB) = first player of team QB
, etc.
I hope this helps! Let me know if you would like me to upload the file for you.
Best, Ioannis