<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Optmodel Efficiency in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Optmodel-Efficiency/m-p/177037#M920</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be willing to share your data and model code? I can take a look and perhaps make a suggestion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Nov 2014 23:13:16 GMT</pubDate>
    <dc:creator>Matthew_Galati</dc:creator>
    <dc:date>2014-11-18T23:13:16Z</dc:date>
    <item>
      <title>Optmodel Efficiency</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Optmodel-Efficiency/m-p/177035#M918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking for help in terms of improving the efficiency/runtime of Proc Optmodel. Here's some background on my problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's specifically optimizing selection. I have 200,000 rows with the variable being a Binary Include flag. The subset I want "included" has to meet various constraints in the aggregate - weighted averages, sums, etc.&lt;/P&gt;&lt;P&gt;I am using the Mixed Integer Linear solver, as that is the one that works given I have a Binary variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Issue is that once I add a key constraint, the runtime has increased from 20 seconds to above 4 minutes. I know that this key constraint is "limiting", ie the result is right at my constraint boundary. Otherwise, it is very similar to other constraints I have that do not seem to slow down runtime. I know optmodel has tons of options, but I'm just not sure which could help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did cut the runtime in half by setting Presolver=aggressive, but I'm weary about what this actually does to the data. I get the following in log:&lt;/P&gt;&lt;P&gt;"WARNING: Removed 17 constraint coefficients whose absolute values are not greater than 1E-9." This confuses me because none of the hard coded values I have in there are &amp;lt; 1E-9, but maybe I need to better understand what all is included in a constraint coefficient. I'm nopt using any other options on the solve line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if anything else will help describe my problem. Any suggestions are greatly appreciated! Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 23:11:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Optmodel-Efficiency/m-p/177035#M918</guid>
      <dc:creator>wefeqwF</dc:creator>
      <dc:date>2014-11-18T23:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: Optmodel Efficiency</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Optmodel-Efficiency/m-p/177036#M919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please post your code, along with the data if possible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 23:13:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Optmodel-Efficiency/m-p/177036#M919</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2014-11-18T23:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Optmodel Efficiency</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Optmodel-Efficiency/m-p/177037#M920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be willing to share your data and model code? I can take a look and perhaps make a suggestion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 23:13:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Optmodel-Efficiency/m-p/177037#M920</guid>
      <dc:creator>Matthew_Galati</dc:creator>
      <dc:date>2014-11-18T23:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Optmodel Efficiency</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Optmodel-Efficiency/m-p/177038#M921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are unable to share your original code, you may want to at least try finding these small coefficients. They are probably a sign that your model could be improved by handling some special case in the data more precisely.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way to find them is to use the expand statement, then search for E- (like that, with no spaces) in the results. That will match scientific notation. For example, this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;
&lt;P&gt;proc optmodel;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var XE, Y;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; con SmallCoefficients{i in 1..10}: 1/(10**i)* xE - 6*y &amp;lt;= 1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; expand;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will produce:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;
&lt;P&gt;Var XE&lt;/P&gt;
&lt;P&gt;Var Y&lt;/P&gt;
&lt;P&gt;Constraint SmallCoefficients[1]: 0.1*XE - 6*Y &amp;lt;= 1&lt;/P&gt;
&lt;P&gt;Constraint SmallCoefficients[2]: 0.01*XE - 6*Y &amp;lt;= 1&lt;/P&gt;
&lt;P&gt;Constraint SmallCoefficients[3]: 0.001*XE - 6*Y &amp;lt;= 1&lt;/P&gt;
&lt;P&gt;Constraint SmallCoefficients[4]: 0.0001*XE - 6*Y &amp;lt;= 1&lt;/P&gt;
&lt;P&gt;Constraint SmallCoefficients[5]: 0.00001*XE - 6*Y &amp;lt;= 1&lt;/P&gt;
&lt;P&gt;Constraint SmallCoefficients[6]: 1E-6*XE - 6*Y &amp;lt;= 1&lt;/P&gt;
&lt;P&gt;Constraint SmallCoefficients[7]: 1E-7*XE - 6*Y &amp;lt;= 1&lt;/P&gt;
&lt;P&gt;Constraint SmallCoefficients[8]: 1E-8*XE - 6*Y &amp;lt;= 1&lt;/P&gt;
&lt;P&gt;Constraint SmallCoefficients[9]: 1E-9*XE - 6*Y &amp;lt;= 1&lt;/P&gt;
&lt;P&gt;Constraint SmallCoefficients[10]: 1E-10*XE - 6*Y &amp;lt;= 1&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;Because of the way optmodel formats the output, you will only encounter the E- pattern in a small number, unless your data encodes it in a string.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 05:20:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Optmodel-Efficiency/m-p/177038#M921</guid>
      <dc:creator>LeoLopes</dc:creator>
      <dc:date>2014-11-19T05:20:05Z</dc:date>
    </item>
  </channel>
</rss>

