$ondollar title VP Location (LP) Example 4.8 of Rardin (1998) $offsymxref offsymlist offuelxref offuellist offupper option limrow = 0, limcol = 0; sets i "old facilities" /1*3/, j "new facilities" /1*2/; alias (j,jp); table mhld(i,j) "material handling cost per foot, old to new" 1 2 1 1.10 2 0.70 0.65 3 0.40; table jmhld(j,jp) "material handling cost per foot, new to new" 1 2 1 2 4.00; parameter h(i) "x-coordinate of i" /1 300, 2 0, 3 600/; parameter k(i) "y-coordinate of i" /1 1200, 2 600, 3 0/; free variable cost "total materials handling cost"; positive variables x(j) "x-coordinate of new facility j", y(j) "y-coordinate of new facility j", xp(i,j) "positive x distance from i to j", yp(i,j) "positive y distance from i to j", xn(i,j) "negative x distance from i to j", yn(i,j) "negative y distance from i to j", jxp(j,jp) "positive x distance from new j to jp", jxn(j,jp) "negative x distance from new j to jp", jyp(j,jp) "positive y distance from new j to jp", jyn(j,jp) "negative y distance from new j to jp"; equations obj "total materials handling cost", defjx(j,jp) "x difference of new facilities", defjy(j,jp) "y difference of new facilities", defx(i,j) "x difference definition for i and j", defy(i,j) "y difference definition for i and j"; obj.. cost =e= sum((i,j)$(mhld(i,j) gt 0), mhld(i,j)*( xp(i,j) + xn(i,j) + yp(i,j) + yn(i,j) ) ) + sum((j,jp)$(ord(j) ne ord(jp)), jmhld(j,jp)*( jxp(j,jp) + jxn(j,jp) + jyp(j,jp) + jyn(j,jp) ) ); defjx(j,jp)$(ord(j) ne ord(jp)).. x(j) - x(jp) =e= jxp(j,jp)- jxn(j,jp); defjy(j,jp)$(ord(j) ne ord(jp)).. y(j) - y(jp) =e= jyp(j,jp) - jyn(j,jp); defx(i,j)$(mhld(i,j) gt 0).. x(j) - h(i) =e= xp(i,j) - xn(i,j); defy(i,j)$(mhld(i,j) gt 0).. y(j) - k(i) =e= yp(i,j) - yn(i,j); model vploc /all/; solve vploc using lp minimizing cost;