$ondollar title EMS (ILP) Example 11.3 of Rardin (1998) $offsymxref offsymlist offuelxref offuellist offupper option limrow = 0, limcol = 0; sets d "districts" /1*20/, j "locations" /1*10/; table cov(d,j) "whether j covers d" 1 2 3 4 5 6 7 8 9 10 1 1 2 1 1 3 1 1 4 1 5 1 6 1 7 1 1 8 1 1 9 1 10 1 1 11 1 1 12 1 1 1 13 1 1 1 14 1 1 15 1 1 16 1 1 17 1 1 1 18 1 1 19 1 1 20 1; parameter imp(d) "importance of covering district d" /1 5.2, 2 4.4, 3 7.1, 4 9.0, 5 6.1, 6 5.7, 7 10.0, 8 12.2, 9 7.6, 10 20.3, 11 30.4, 12 30.9, 13 12.0, 14 9.3, 15 15.5, 16 25.6, 17 11.0, 18 5.3, 19 7.9, 20 9.9/; free variables numloc "number of locations used", uncov "total importance of uncovered sites"; binary variables x(j) "whether to use location j", y(d) "whether to leave d uncovered"; equations num "min number of locations used", val "min importance of uncovered locations", covwo(d) "provide coverage for d without y(d)", covw(d) "provide coverage for d allowing y(d)", max4 "at most 4 locations used"; num.. numloc =e= sum(j, x(j)); val.. uncov =e= sum(d, imp(d)*y(d)); covwo(d).. sum(j, cov(d,j)*x(j)) =g= 1; covw(d).. sum(j, cov(d,j)*x(j)) + y(d) =g= 1; max4.. sum(j, x(j)) =l= 4; model mincover /num, covwo/; solve mincover using mip minimizing numloc; model minuncover /val, covw, max4/; solve minuncover using mip minimizing uncov;