<?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: Replicate excel output of solver using Proc Optmodel. in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/488803#M2372</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This Helps. It ran after we made &amp;lt;= in MILP. We were able to do it for 10,000 rows. But, when tried for 100k rows, it gave error. Any suggestions how do we run it as we need to run it for 2 million rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;P&gt;Swapneel Kitcha&lt;/P&gt;</description>
    <pubDate>Wed, 22 Aug 2018 09:26:39 GMT</pubDate>
    <dc:creator>Swapneel</dc:creator>
    <dc:date>2018-08-22T09:26:39Z</dc:date>
    <item>
      <title>Replicate excel output of solver using Proc Optmodel.</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/487758#M2361</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to solve this using proc optmodel. But, not able to do. Can anyone help me in this regards. It works when c2 value is changed to 0.5. But, doesn't work with 0.13. P1 and P2 are probabilities. F1 and F2 are frequency. They should be integer. c1 and C2 are cost per f1 and f2 respectively.&amp;nbsp; f1*c1+f2*c2 should be less than cost.&lt;/P&gt;&lt;P&gt;objective function is maximise&amp;nbsp;p1[I]*f1[I]*c1[I]+p2[I]*f2[I]*c2[I]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data temp;&lt;BR /&gt;infile DATALINES dsd missover;&lt;BR /&gt;input id cr1 cr2&amp;nbsp;P1&amp;nbsp;P2&amp;nbsp;F1&amp;nbsp;F2&amp;nbsp;C1&amp;nbsp;C2 cost;&lt;BR /&gt;CARDS;&lt;BR /&gt;1,0.7,0.2,0.7,0.3,2,0,2,0.13,10&lt;BR /&gt;2,0.7,0.2,0.894965079197824,0.105034920802176,5,0,2,0.13,15&lt;BR /&gt;3,0.7,0.2,0.94779739712309,0.0522026028769104,2,0,2,0.13,20&lt;BR /&gt;4,0.7,0.2,0.993687038743847,0.00631296125615344,1,1,2,0.13,25&lt;BR /&gt;5,0.7,0.2,0.594148011375916,0.405851988624084,1,1,2,0.13,10&lt;BR /&gt;6,0.7,0.2,0.419275472526551,0.580724527473449,1,0,2,0.13,15&lt;BR /&gt;7,0.7,0.2,0.540976095560129,0.459023904439871,2,1,2,0.13,20&lt;BR /&gt;8,0.7,0.2,0.321767691744239,0.678232308255761,2,1,2,0.13,25&lt;BR /&gt;9,0.7,0.2,0.186053772182906,0.813946227817094,0,2,2,0.13,10&lt;BR /&gt;10,0.7,0.2,0.515581052099613,0.484418947900387,1,2,2,0.13,15&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc optmodel;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; set&amp;lt;num&amp;gt; indx;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; number&amp;nbsp; cr1{indx}, cr2{indx} , p1{indx} , p2{indx} , c1{indx} , c2{indx} , cost{indx} ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; var F1{indx}&amp;nbsp; init&amp;nbsp; ,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; F2{indx}&amp;nbsp; init&amp;nbsp; ,&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Z1 {indx} ,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Z2 {indx} ,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; y1 {indx},&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; y2 {indx},&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; X1 {indx} integer,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; X2 {indx} integer&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; read data&amp;nbsp; temp&amp;nbsp; into&amp;nbsp; indx=[_N_]&lt;BR /&gt;&amp;nbsp;cr1 = cr1 cr2 = cr2 p1 = p1 p2 = p2 c1=c1&lt;BR /&gt;&amp;nbsp;c2=c2 cost = cost ;&lt;BR /&gt;&amp;nbsp;print&amp;nbsp; cr1 cr2&amp;nbsp;P1&amp;nbsp;P2&amp;nbsp;F1&amp;nbsp;F2&amp;nbsp;C1&amp;nbsp;C2 cost;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;number n = &amp;amp;_Nobs.;&amp;nbsp; /* size of matrix */&lt;BR /&gt;con b1 {i in 1..10}: y1[i]= (P1[i] *F1[i]* c1[i]);&lt;BR /&gt;con b2 {i in 1..10}: Y2[i]=&amp;nbsp; (P2[i] *F2[i]* c2[i]);&lt;BR /&gt;con a1{i in 1..10}: Z1[i]= (F1[i] * C1[i]);&lt;BR /&gt;con a2{i in 1..10}: Z2[i]= (F2[i] * C2[i]);&lt;BR /&gt;con a3{i in 1..10}: x1[i]= (F1[i]);&lt;BR /&gt;con a4{i in 1..10}: x2[i]= (F2[i]);&lt;/P&gt;&lt;P&gt;con Eq1 {i in 1..10}: X1[i] + X2[i] &amp;gt;= 2 ;&lt;/P&gt;&lt;P&gt;con Eq3 {i in 1..10}: X1[i] &amp;lt;= 100 ;&lt;BR /&gt;con Eq4 {i in 1..10}: X2[i] &amp;lt;= 100 ;&lt;BR /&gt;*con Eq5 {i in 1..10}: (Z1[i]*c1[i] + Z2[i]*c2[i]) &amp;lt;= cost[i] ;&lt;BR /&gt;con Eq6 {i in 1..10}:&amp;nbsp; (Z1[i]+ Z2[i]) = cost[i] ;&lt;BR /&gt;min Total_cost = sum{i in 1..n}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (y1[i]&amp;nbsp; + y2[i]) ;&lt;BR /&gt;solve ;&lt;BR /&gt;&amp;nbsp; print&amp;nbsp; F1&amp;nbsp; F2&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Swapneel&lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2018 13:35:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/487758#M2361</guid>
      <dc:creator>Swapneel</dc:creator>
      <dc:date>2018-08-17T13:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate excel output of solver using Proc Optmodel.</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/487949#M2362</link>
      <description>&lt;P&gt;You have a few syntax errors:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Remove the two blank lines in the DATA step.&lt;/LI&gt;
&lt;LI&gt;Change INIT to INTEGER in the VAR statement.&lt;/LI&gt;
&lt;LI&gt;You have not supplied a value for Nobs, but you don't need it if you change 1..n to indx in the MIN statement.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;After I corrected those, with c2 = 0.5 I got the following:&lt;/P&gt;
&lt;P&gt;NOTE: Problem generation will use 4 threads.&lt;BR /&gt;NOTE: The problem has 80 variables (80 free, 0 fixed).&lt;BR /&gt;NOTE: The problem has 0 binary and 40 integer variables.&lt;BR /&gt;NOTE: The problem has 100 linear constraints (20 LE, 70 EQ, 10 GE, 0 range).&lt;BR /&gt;NOTE: The problem has 180 linear constraint coefficients.&lt;BR /&gt;NOTE: The problem has 0 nonlinear constraints (0 LE, 0 EQ, 0 GE, 0 range).&lt;BR /&gt;NOTE: The OPTMODEL presolver is disabled for linear problems.&lt;BR /&gt;NOTE: The initial MILP heuristics are applied.&lt;BR /&gt;NOTE: The MILP presolver value AUTOMATIC is applied.&lt;BR /&gt;NOTE: The MILP presolver removed all variables and constraints.&lt;BR /&gt;NOTE: Optimal.&lt;BR /&gt;NOTE: Objective = -66.23120545.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And with c2 = 0.13 I got:&lt;/P&gt;
&lt;P&gt;NOTE: Problem generation will use 4 threads.&lt;BR /&gt;NOTE: The problem has 80 variables (80 free, 0 fixed).&lt;BR /&gt;NOTE: The problem has 0 binary and 40 integer variables.&lt;BR /&gt;NOTE: The problem has 100 linear constraints (20 LE, 70 EQ, 10 GE, 0 range).&lt;BR /&gt;NOTE: The problem has 180 linear constraint coefficients.&lt;BR /&gt;NOTE: The problem has 0 nonlinear constraints (0 LE, 0 EQ, 0 GE, 0 range).&lt;BR /&gt;NOTE: The OPTMODEL presolver is disabled for linear problems.&lt;BR /&gt;NOTE: The initial MILP heuristics are applied.&lt;BR /&gt;NOTE: The MILP presolver value AUTOMATIC is applied.&lt;BR /&gt;NOTE: The MILP presolver removed all variables and constraints.&lt;BR /&gt;NOTE: Optimal.&lt;BR /&gt;NOTE: Objective = 88.133995317.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, I noticed that you did not use cr1 and cr2 anywhere.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And did you maybe forget to put lower bounds of 0 on F1 and F2?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2018 20:54:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/487949#M2362</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2018-08-17T20:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate excel output of solver using Proc Optmodel.</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/488559#M2368</link>
      <description>Hi Rob, Thanks for reply. It helped for this data. When scaled with multiple variables and 10,000 records. It gave out of memory error. Also, for some cases it was saying MILP does not solve inequality constraint. Could you please advice what to do. Thanks and Regards Swapneel</description>
      <pubDate>Tue, 21 Aug 2018 13:56:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/488559#M2368</guid>
      <dc:creator>Swapneel</dc:creator>
      <dc:date>2018-08-21T13:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate excel output of solver using Proc Optmodel.</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/488562#M2369</link>
      <description>&lt;P&gt;Also, getting error "&lt;/P&gt;&lt;P&gt;The problem contains strict inequality or predicate constraints that reference non-integer variables"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 14:00:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/488562#M2369</guid>
      <dc:creator>Swapneel</dc:creator>
      <dc:date>2018-08-21T14:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate excel output of solver using Proc Optmodel.</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/488614#M2370</link>
      <description>&lt;P&gt;Please share the new data and code.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 15:02:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/488614#M2370</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2018-08-21T15:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate excel output of solver using Proc Optmodel.</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/488616#M2371</link>
      <description>&lt;P&gt;I suspect you have introduced a &amp;lt; or &amp;gt; instead of &amp;lt;= or &amp;gt;=.&amp;nbsp; The CLP solver allows such strict inequalities, but only if all variables are declared to be integer/binary.&amp;nbsp; The MILP solver does not allow strict inequalities.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 15:05:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/488616#M2371</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2018-08-21T15:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate excel output of solver using Proc Optmodel.</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/488803#M2372</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This Helps. It ran after we made &amp;lt;= in MILP. We were able to do it for 10,000 rows. But, when tried for 100k rows, it gave error. Any suggestions how do we run it as we need to run it for 2 million rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;P&gt;Swapneel Kitcha&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 09:26:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/488803#M2372</guid>
      <dc:creator>Swapneel</dc:creator>
      <dc:date>2018-08-22T09:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate excel output of solver using Proc Optmodel.</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/488837#M2373</link>
      <description>Please share the new code and data.</description>
      <pubDate>Wed, 22 Aug 2018 12:15:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/488837#M2373</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2018-08-22T12:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate excel output of solver using Proc Optmodel.</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/489624#M2383</link>
      <description>Hi Rob, Thanks a lot for your help. Sincerely appreciate it. Will reach out to you further, in case of any issues. Thanks and regards Swapneel</description>
      <pubDate>Fri, 24 Aug 2018 14:57:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/489624#M2383</guid>
      <dc:creator>Swapneel</dc:creator>
      <dc:date>2018-08-24T14:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate excel output of solver using Proc Optmodel.</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/489629#M2384</link>
      <description>&lt;P&gt;Glad to help.&amp;nbsp; If you are still running out of memory for larger instances, please share your new data and code.&amp;nbsp; The original code has several opportunities for efficiency improvements.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 15:02:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Replicate-excel-output-of-solver-using-Proc-Optmodel/m-p/489629#M2384</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2018-08-24T15:02:30Z</dc:date>
    </item>
  </channel>
</rss>

