$title Gandhi problem (modified) option limrow=0, limcol=0; set item /shirt, shorts, pants/; set input / labor "hours available per week" cloth "square yards available per week"/; set revcost / price "selling price in dollars" var-cost "variable cost in dollars"/; parameter rentmach(item) "cost of rental in dollars/week" / shirt 30, shorts 50, pants 20/; parameter capacityMachine(item) "capacity of each machine" / shirt 10, shorts 10, pants 8/; * Table 2 from Winston table requirements(item,input) labor cloth shirt 3 4 shorts 2 3 pants 6 4; * Table 3 from Winston table revenue(item,revcost) price var-cost shirt 12 6 shorts 8 4 pants 15 8; parameter resources (input) / labor 150, cloth 160/; positive variable amount(item); integer variable numberMachines(item); variable profit; equations EQresources(input), EQrental(item), objective; * usual LP resource constraints EQresources(input).. sum(item,requirements(item,input)*amount(item)) =l= resources(input); * apply capacity constraints for each item depending on * number of machines rented EQrental(item).. amount(item) =l= numberMachines(item)*capacityMachine(item); objective.. profit =e= sum(item, revenue(item,'price')*amount(item)) - sum(item, revenue(item,'var-cost')*amount(item)) - sum(item, rentmach(item) * numberMachines(item)); model fixedCostExample/all/; * choose cplex solver option mip=cplex; * ensure calculation of exact solution fixedCostExample.optcr=0; solve fixedCostExample using mip maximizing profit;