proc optmodel; set DC = {'BO','NA','PR','SP','WO'}; set City = {'BO','BR','CO','HA','MN','NA','NH','NL','PO','PR','SP','WO'}; number varcost{DC,City}=[ 0 93 69 98 55 37 128 95 62 42 82 34 37 65 33 103 20 0 137 113 48 72 79 41 42 106 105 73 92 72 94 57 104 0 68 38 82 59 101 27 93 79 63 57 127 68 0 47 34 68 72 66 60 41 98 71 85 38 47 0 ]; number fixcost{DC} = [10000 10000 10000 10000 10000]; number capacity{DC} = [1746 1746 1746 1746 1746]; number demand{City} = [425 12 43 125 110 86 129 28 66 320 220 182]; number Pmin = 1; number Pmax = 1; var open{DC} binary; var flow{DC, City} >= 0; minimize TotalCost = /*Fixed Costs*/ sum{i in DC}fixcost[i]*open[i] + /*Transportation Costs*/ sum{i in DC, j in City}flow[i,j]*varcost[i,j] ; con capacitycon{i in DC}: sum{j in City}flow[i,j] <= capacity[i]; con demandcon{j in City}: sum{i in DC}flow[i,j] >= demand[j]; con linkingcon{i in DC, j in City}: flow[i,j]-2000*open[i] <= 0; con mincon: sum{i in DC}open[i] >= Pmin; con maxcon: sum{i in DC}open[i] <= Pmax; solve; print TotalCost open flow; expand; quit;