<div dir="ltr"><div><div><div>good evening, I am new to CMPL.  I took several LP and combination optimization courses in university - in other words I am very new to this!  I have successfully created a model in SolverStudio and the results seem reasonable.  I am now attempting to change the objective function so the that difference between the delivered volume versus the demand is a ratio (or absolute).  Attached is my model:<br>------------------------------------------------------------------------------------------------------------------------------------------<br>%data : sources set, destinations set, s[sources], d[destinations], c[sources,destinations] <br>%display nonZeros<br><br>parameters:<br>    { i in sources , j in destinations: costs[i,j]:= c[i,j]*d[j]; }    <br>    <br>variables:<br>    x[sources,destinations]: binary;<br><br>objectives:<br>    Total_cost: sum{i in sources, j in destinations : costs[i,j] * x[i,j]} +<br>                sum{i in sources  : sum{j in destinations: d[j]*x[i,j]} - s[i]}  ->min;<br><br>constraints:<br>    supplies {i in sources  : sum{j in destinations: d[j]*x[i,j]} >= s[i]*0.8;}<br>    demands  {j in destinations : sum{i in sources : x[i,j]} =  1;} <br>------------------------------------------------------------------------------------------------------------------------------------------<br><br></div>I would like to try something like this for my objectives:<br><br>    Total_cost: sum{i in sources, j in destinations : costs[i,j] * x[i,j]} +<br>                sum{i in sources  : sum{j in destinations: d[j]*x[i,j]} - s[i]}<b>/s[i]</b>  ->min;<br><br></div>As i mentioned above I am attempting to make the OF minimize the error as a percentage delivered to each destination.  This is meant to overcome the problem of an under or over delivery is offset by an equal (negative or positive) amount so the function is not really minimizing the value (it is always almost zero due to aggregation of offsetting positive and negative values).  <br></div><div><br></div><div>Attached is an OpenSolver excel model (in a zip file).  Please note I have made all the costs equal to 1 to better diagnose the OF's second term.</div><div><br></div><div>Any suggestions would be appreciated!  thank you. <br></div><br></div>