For Draft Kings, the model would look something like this... I am leaving out some details about how the data is pulled in from Excel (my Excel projection sheet is probably different than yours). The basic model is mostly here. The only rule I left out is that players must be selected from two different teams. But, in my experience, this hardly ever happens in practice. Good luck - if you figure out how to beat Draft Kings - please let me know! set<str> PLAYERS; num salary{PLAYERS}; num points{PLAYERS}; str team{PLAYERS}; str position{PLAYERS}; read data dk_data into PLAYERS=[player] position salary points=Projected_Fantasy_Points team; set<str> POSITIONS = union{p in PLAYERS}{position }; num required = 8; /* >= 1 PG, 1 SG, 1 SF, 1C >= 1 PG or SG >= 1 PF or SF >= 1 PG or SG or PF or SF = UTIL */ num requiredMin{POSITIONS} = [["PG"] 1 ["SG"] 1 ["SF"] 1 ["PF"] 1 ["C"] 1]; num budget = 50000; var x{p in PLAYERS} binary; max TotalPoints = sum{p in PLAYERS} x * points ; con budgetcon: sum{p in PLAYERS} x * salary <= budget; con positionTotal: sum{p in PLAYERS} x = required; con positionMin{i in POSITIONS}: requiredMin <= sum{p in PLAYERS : position =i} x ; con positionGuard: sum{p in PLAYERS : position ="PG" or position ="SG"} x >= 3; con positionForward: sum{p in PLAYERS : position ="PF" or position ="SF"} x >= 3;
... View more