Hi, I have 2 data sets with location data as below. DS1 Ofc name, Easting, Northing DS2 Emp name,Easting, Northing The code I have written is as follows. proc optmodel; set two = 1..2; set<string> ofc; set<string> pm; num ofc_loc{ofc,two}; num pm_loc{pm,two}; var ofc_use{ofc} binery; /* office used */ var dec_var{pm,ofc} binery; /* decision variable */ read data DS1 into ofc=[office_name] ofc_loc[office_name,1]=easting ofc_loc[office_name,2]=northing; read data DS2 into pm=[pm_nm] pm_loc[pm_nm,1]=eastings pm_loc[pm_nm,2]=northings; constraint con1{p in pm}: sum{o in ofc} dec_var[p,o]=1; /* 1 office per pm */ constraint con2: sum{p in pm,o in ofc} ofc_use[o]*dec_var[p,o]=20; /* 20 ofc to use */ /*constraint con4{p in pm,o in ofc}: 0<=dec_var[p,o]<=1;*/ /* want the decision variables to be binary */ /*constraint con5{o in ofc}: 0<=ofc_use[o]<=1;*/ /* need con4 and con5 if variables are declared as integer */ min dismin = sum{p in pm,o in ofc} dec_var[p,o]*(((pm_loc[p,1]-ofc_loc[o,1])**2+(pm_loc[p,2]-ofc_loc[o,2])**2)**(0.5)); /* minimise distance */ solve; quit; The con2 above is becoming non linear. Due to that, the variables need to be number and not integer and also con4 and con5 are required. Ultimately the solver is unable to solve the problem and cannot find a solution. Is it possible to convert this into a linear programming problem? Any help will be greatly appreciated. Thanks Arindam
... View more