$title Warehouse problem: Winston pg 482 $ontext Meet weekly demands at minimum cost, subject to a) capacity on warehouse at each site b) fixed opening cost for each site c) requirements in each region d) cost of sending 1 unit from a plant to a region shown below e) if new-york opened, so must los-angeles f) at most two warehouses can be opened g) either atlanta or los-angeles must be opened $offtext set sites /new-york,los-angeles,chicago,atlanta/; set regions /1*3/; parameter fixedc(sites) / new-york 400 los-angeles 500 chicago 300 atlanta 150 /; scalar capacity /100/; parameter require(regions) / 1 80 2 70 3 40 /; table cost(sites,regions) 1 2 3 new-york 20 40 50 los-angeles 48 15 26 chicago 26 35 18 atlanta 24 50 35 ; positive variables amt(sites,regions); binary variables use(sites); variables totalCost; equations cap(sites), demand(regions), defUse, defobj, conse, consf, consg; cap(sites).. sum(regions,amt(sites,regions)) =l= capacity; demand(regions).. sum(sites,amt(sites,regions)) =g= require(regions); defUse(sites,regions).. amt(sites,regions) =l= require(regions) * use(sites); * aggregated formulation * defUse(sites).. * sum(regions,amt(sites,regions)) =l= 10000000 * use(sites); defobj.. totalCost =e= sum(sites,fixedc(sites)*use(sites)) + sum((sites,regions),cost(sites,regions)*amt(sites,regions)); conse.. use('new-york') =l= use('los-angeles'); consf.. sum(sites,use(sites)) =l= 2; consg.. use('atlanta') + use('los-angeles') =g= 1; model warehouse /all/; warehouse.optcr = 0; solve warehouse using mip min totalCost;