I have below data: id $ cost profit_1 profit_2 score; A -1 10 11 500 B -0.6 10 5 700 C -0.75 10 10.5 700 D -0.75 10.5 10 600 E -0.65 12 11 300 F -0.65 12 13 350; Following code does the work when considering profits only: proc optmodel; set <str> ITEMS; num cost {ITEMS}; set CASES = 1..2; num profit {ITEMS, CASES}; read data have into ITEMS=[id] cost {j in CASES} <profit[id,j]=col('profit_'||j)>; var X {ITEMS, CASES} binary; max TotalProfit = sum {i in ITEMS, j in CASES} profit[i,j] * X[i,j]; con ChooseOne {i in ITEMS}: sum {j in CASES} X[i,j] <= 1; con Budget: sum {i in ITEMS, j in CASES} cost[i] * X[i,j] <= 1.5; solve; print X; quit; but I want to add another constraint on score. Something like SCORE must be greater than 500, i tried inserting following - num score {ITEMS} then in read data statement- SCORE[id] = col('SCORE') And finally the constraint- con MinScore SCORE{i in ITEMS}: SCORE[id]>=500 but this is leading to infeasible solution because of cases where SCORE >=500. Can anyone help in how to do this and what am I doing wrong?
... View more