<?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: SAS/OR please help with a beginner's code in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/502835#M2432</link>
    <description>&lt;P&gt;To say if I want to create a quantitative constraint "choose items from the dataset with pvalue&amp;gt;=0.1" , how should I express this constraint in SAS/OR? This time the question should be clear. Thank you!&lt;/P&gt;&lt;P&gt;All the constraints in this example used "sum", tried a few times but failed.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Oct 2018 18:21:11 GMT</pubDate>
    <dc:creator>Germs</dc:creator>
    <dc:date>2018-10-09T18:21:11Z</dc:date>
    <item>
      <title>SAS/OR please help with a beginner's code</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/497336#M2403</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data has three columns(450 raws): itemID,&lt;/P&gt;&lt;P&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; &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; Pvalue(the probability of each item happens),&lt;/P&gt;&lt;P&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; &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; rptbis (the point-biserial correlation).&lt;/P&gt;&lt;P&gt;e.g. variable names+ first three rows (full data set is in excel document in attachment):&lt;/P&gt;&lt;P&gt;ItemID pvalue rptbis&lt;BR /&gt;00001 0.295 0.437&lt;BR /&gt;00002 0.033 0.869&lt;BR /&gt;00003 0.988 0.964&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The goal is to pick up 50 items from the pool to meet a few requirements using MIP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Objective function&lt;/P&gt;&lt;P&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;Min y;&lt;/P&gt;&lt;P&gt;Subject to:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sum(x[i]*Pvalue[i])&amp;gt;32-y;&amp;nbsp; /*&amp;nbsp;sum of "pvalue" of the 50 items should be as close as 32*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sum(x[i]*Pvalue[i])&amp;lt;32+y;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sum(x[i])=50;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/*n=50 to pick up from the pool*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x in (0, 1);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /*x is a binary value in (0, 1) */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; y&amp;gt;=0;&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; /* I am not sure how to define thIS*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 13&amp;gt;=sum{ (&lt;SPAN&gt;pvalue[i]/（1-pvalue[i]))^(1/2)*rptbis[i])}&amp;gt;=12; /* the SD of the items picked should be between 12 and 13*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I never get my code running, please help me with fixing the errors. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc optmodel;&lt;BR /&gt;set &amp;lt;str&amp;gt; pool;&lt;BR /&gt;num ItemID {pool};&lt;BR /&gt;num pvalue {pool};&lt;BR /&gt;num rptbis {pool};&lt;/P&gt;&lt;P&gt;read data itembank into pool=[ItemID]&lt;BR /&gt;pvalue rptbis;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var x{i in pool} binary; /*x in (0,1);*/&lt;BR /&gt;&lt;BR /&gt;min y=sum{i in pool}(x[i]*pvalue[i])-32;&amp;nbsp; /*issue #1, how can I define the objective value &amp;gt;0 ?*/&lt;/P&gt;&lt;P&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; &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;impvar sd=sum{i in pool}(pvalue[i]/（1-pvalue[i]）^(1/2)*rptbis[i]）;&lt;BR /&gt;con 13&amp;lt;=sd&amp;lt;=12;&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; &amp;nbsp; &amp;nbsp; /*when I had this constraint, it said "infeasible", sad!*/&lt;BR /&gt;&lt;BR /&gt;con sum{i in pool}(x[i]*pvalue[i])&amp;gt;32-y;&amp;nbsp; &amp;nbsp; &amp;nbsp; /*when I had this 2 con, I wrote objective function as "min y", it said "no objective function"*/&lt;BR /&gt;con sum{i in pool}(x[i]*pvalue[i])&amp;lt;32+y;&lt;BR /&gt;con sum{i in pool}x[i]=50;&lt;BR /&gt;solve with MILP;&lt;BR /&gt;print x pvalue;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 02:43:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/497336#M2403</guid>
      <dc:creator>Germs</dc:creator>
      <dc:date>2018-09-21T02:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/OR please help with a beginner's code</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/497522#M2408</link>
      <description>&lt;P&gt;Please share your itembank data.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 19:08:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/497522#M2408</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2018-09-20T19:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/OR please help with a beginner's code</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/498808#M2413</link>
      <description>&lt;P&gt;I made several changes here.&amp;nbsp; I'm not sure what you intended with sd, but your original IMPVAR had no variables on the right-hand side, so sd was a constant.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc optmodel;
   set &amp;lt;str&amp;gt; pool;
   num ItemID {pool};
   num pvalue {pool};
   num rptbis {pool};
   read data itembank into pool=[ItemID]
      pvalue rptbis;

   var x{i in pool} binary; /*x in (0,1);*/

   var y &amp;gt;= 0;
   min z = y;*=sum{i in pool}(x[i]*pvalue[i])-32;  /*issue #1, how can I define the objective value &amp;gt;0 ?*/

/*   impvar sd=sum{i in pool}(pvalue[i]/(1-pvalue[i])^(1/2)*rptbis[i]);*/
   impvar sd=sum{i in pool}(pvalue[i]/(1-pvalue[i])^(1/2)*rptbis[i])*x[i];
*   con 13&amp;lt;=sd&amp;lt;=12;                                          /*when I had this constraint, it said "infeasible", sad!*/
   con 12&amp;lt;=sd&amp;lt;=13;

   con sum{i in pool}(x[i]*pvalue[i])&amp;gt;=32-y;      /*when I had this 2 con, I wrote objective function as "min y", it said "no objective function"*/
   con sum{i in pool}(x[i]*pvalue[i])&amp;lt;=32+y;
   con sum{i in pool}x[i]=50;
   solve;
   print x pvalue;
   print (sum{i in pool}(x[i]*pvalue[i]));
   print sd;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Sep 2018 18:39:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/498808#M2413</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2018-09-25T18:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/OR please help with a beginner's code</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/498927#M2416</link>
      <description>&lt;P&gt;Thank you soooooo much!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After last post, I have figured out the mistakes I made, and corrected the computation of SD term. But what you wrote is much better than mine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here I have 2 extra questions:&lt;/P&gt;&lt;P&gt;Question 1. For a further modification of this program, e.g. to add a dimension, the output will be like this:&lt;/P&gt;&lt;P&gt;[1]&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x1&amp;nbsp; &amp;nbsp;x2&amp;nbsp; x3&amp;nbsp; ....&amp;nbsp; x5;&lt;BR /&gt;00001&amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp;1&amp;nbsp; ....&amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;00002&amp;nbsp; 0&amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp;....&amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;00003&amp;nbsp; 1&amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp;....&amp;nbsp; &amp;nbsp; 0&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;..................&lt;/P&gt;&lt;P&gt;..................&lt;/P&gt;&lt;P&gt;00450&amp;nbsp; 0&amp;nbsp; 1&amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp;......&amp;nbsp; &amp;nbsp; 0;&lt;/P&gt;&lt;P&gt;which means I wish to select multiple groups x[i,j ] require:&lt;/P&gt;&lt;P&gt;for each group( in 1 to j) , choose 50 item from the pool:sum(x[ i ])=50;&lt;/P&gt;&lt;P&gt;each item can only goes into one group: sum(x)&amp;lt;=1, no overlap;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created another dataset named "group" with only 1 variable (x1-x5), but I could not read x1-x5 into the dataset [pool] to make another dimension, I also don't know how to modify the program in "proc optmodel";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question 2: can "proc optmodel" be used in SAS Macro? e.g.&lt;/P&gt;&lt;P&gt;%macro forms (group= );&lt;/P&gt;&lt;P&gt;data xxx;&lt;/P&gt;&lt;P&gt;set xxx;&lt;/P&gt;&lt;P&gt;.........;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc optmodel;&lt;/P&gt;&lt;P&gt;.......;&lt;/P&gt;&lt;P&gt;.......;&lt;/P&gt;&lt;P&gt;.......;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%forms (group=5);&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!!! Appreciate!!!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 02:49:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/498927#M2416</guid>
      <dc:creator>Germs</dc:creator>
      <dc:date>2018-09-26T02:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/OR please help with a beginner's code</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/499203#M2417</link>
      <description>&lt;P&gt;For question 1, I omitted sd.&amp;nbsp; And for this instance, the DECOMP option speeds up the MILP solve.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc optmodel;
   set &amp;lt;str&amp;gt; pool;
   num ItemID {pool};
   num pvalue {pool};
   num rptbis {pool};
   read data itembank into pool=[ItemID] pvalue rptbis;
   set groups = 1..5;

   var x{i in pool, j in groups} binary;
   var y{groups} &amp;gt;= 0;

   min z = sum{j in groups} y[j];
   
/*   impvar sd=sum{i in pool}(pvalue[i]/(1-pvalue[i])^(1/2)*rptbis[i])*x[i];*/
/*   con 12&amp;lt;=sd&amp;lt;=13;*/
   impvar psum{j in groups} = sum{i in pool} pvalue[i]*x[i,j];
   con TargetGE{j in groups}: psum[j] &amp;gt;= 32 - y[j];
   con TargetLE{j in groups}: psum[j] &amp;lt;= 32 + y[j];
   con CountPerGroup{j in groups}: sum{i in pool} x[i,j] = 50;
   con AssignAtMostOnce{i in pool}: sum{j in groups} x[i,j] &amp;lt;= 1;

   solve with milp / decomp;

/*   print x pvalue;*/
   print psum;

   create data soldata from [i]=pool {j in groups} &amp;lt;col('x'||j)=x[i,j]&amp;gt;;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For question 2, the answer is yes.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 17:53:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/499203#M2417</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2018-09-26T17:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/OR please help with a beginner's code</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/500250#M2419</link>
      <description>&lt;P&gt;Thank you so much &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/1636"&gt;@RobPratt&lt;/a&gt;&lt;/P&gt;&lt;P&gt;I will continue developing the code for my project. I will update how it goes.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 02:11:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/500250#M2419</guid>
      <dc:creator>Germs</dc:creator>
      <dc:date>2018-10-01T02:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/OR please help with a beginner's code</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/501010#M2420</link>
      <description>&lt;P&gt;Hello&amp;nbsp;RobPratt. I have tested your code, it worked greatl. Thank you so much.&lt;/P&gt;&lt;P&gt;For my question 2 using SAS macro, I tried using %let group=5, group 1..&amp;amp;group.; it worked.&lt;/P&gt;&lt;P&gt;For my question 1: I still have some details to work on, should I consider the objective function you wrote, means to minimize each y-value in group 1..5?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sas"&gt; &amp;nbsp; &amp;nbsp; min z = sum{j in groups} y[j];&amp;lt;code&amp;gt;&amp;lt;/code&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried both using and not using "decomp" option, it made a difference in speed.&lt;/P&gt;&lt;P&gt;For the last statement using "decomp", can I also have “iis=on”？Are they comparable?&lt;/P&gt;&lt;P&gt;I wish to use MILP/branch and bound/indicate IIS for my project (is that possible?)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sas"&gt;&amp;nbsp; &amp;nbsp;solve with milp /decomp iis=on;&amp;lt;code&amp;gt;&amp;lt;/code&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I tried to replace “decomp” with "IIS=on"(line 384), it gave me the following error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;384 solve with milp /decomp&amp;nbsp; iis=on;&lt;/P&gt;&lt;P&gt;---&lt;BR /&gt;688&lt;BR /&gt;22&lt;BR /&gt;ERROR 688-782: The option IIS is unrecognized.&lt;/P&gt;&lt;P&gt;ERROR 22-322: Expecting one of the following: ABSOBJGAP, ALLCUTS, CONFLICTSEARCH, CUTCLIQUE,&lt;BR /&gt;CUTFLOWCOVER, CUTFLOWPATH, CUTGOMORY, CUTGUB, CUTIMPLIED, CUTKNAPSACK, CUTLAP,&lt;BR /&gt;CUTMILIFTED, CUTMIR, CUTOFF, CUTS, CUTSFACTOR, CUTSTRATEGY, CUTZEROHALF, DECOMP,&lt;BR /&gt;DECOMP_MASTER, DECOMP_MASTER_IP, DECOMP_SUBPROB, EMPHASIS, FEASTOL, HEURISTICS,&lt;BR /&gt;INTTOL, LOGFREQ, LOGLEVEL, MAXNODES, MAXSOLS, MAXTIME, NODESEL, NOPRIMALIN, OPTTOL,&lt;BR /&gt;PRESOLVER, PRIMALIN, PRINTFREQ, PRINTLEVEL2, PRIORITY, PROBE, RELOBJGAP, RESTARTS,&lt;BR /&gt;SCALE, SEED, STRONGITER, STRONGLEN, SYMMETRY, TARGET, TIMETYPE, VARSEL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when I switched to&amp;nbsp; LP, it relax all the constraints and did not pick any x[i] for me.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  solve with lp / iis=on;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WARNING: The problem contains integer variables. The relaxed LP will be solved. Specify the&lt;BR /&gt;RELAXINT keyword on the SOLVE statement to avoid this warning.&lt;BR /&gt;NOTE: The IIS= option is enabled.&lt;BR /&gt;Objective&lt;BR /&gt;Phase Iteration Value Time&lt;BR /&gt;P 1 1 1.774000E+03 0&lt;BR /&gt;P 1 138 1.121796E+02 0&lt;BR /&gt;P 1 233 8.137021E+00 0&lt;BR /&gt;P 1 328 3.910344E-01 0&lt;BR /&gt;P 1 358 0.000000E+00 0&lt;BR /&gt;P 1 359 0.000000E+00 0&lt;BR /&gt;NOTE: The IIS= option found this problem to be feasible.&lt;BR /&gt;NOTE: The IIS solve time is 0.02 seconds.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 14:08:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/501010#M2420</guid>
      <dc:creator>Germs</dc:creator>
      <dc:date>2018-10-03T14:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/OR please help with a beginner's code</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/501283#M2421</link>
      <description>&lt;P&gt;The IIS option for the LP solver (not the MILP solver) is to&amp;nbsp;identify causes of infeasibility.&amp;nbsp; Your problem is feasible, so this option is not applicable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The y[j] variable measures the absolute error between psum[j] and the target value of 32.&amp;nbsp; The objective z minimizes the sum of these errors.&amp;nbsp; For your data, the optimal objective value turns out to be 0, which means that each group j meets the target exactly.&amp;nbsp; You can also see this from the PRINT statement that yields:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Optmodel: PrintTable" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="l b header" scope="col"&gt;[1]&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;psum&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="r data"&gt;32&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="r data"&gt;32&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;3&lt;/TH&gt;
&lt;TD class="r data"&gt;32&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;4&lt;/TH&gt;
&lt;TD class="r data"&gt;32&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;5&lt;/TH&gt;
&lt;TD class="r data"&gt;32&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 03 Oct 2018 21:07:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/501283#M2421</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2018-10-03T21:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/OR please help with a beginner's code</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/501315#M2422</link>
      <description>&lt;P&gt;I have chosen one of your previous solutions (2 dimension's)&amp;nbsp; as the best solution.Thank you so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My initial interest for SAS/OR is detecting IIS, remember you replied my first post here:&lt;/P&gt;&lt;P&gt;&lt;A title="https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-in-LP-MIP-which-method-is-used-for-detecting-IIS/m-p/495128#M2394" href="https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-in-LP-MIP-which-method-is-used-for-detecting-IIS/m-p/495128#M2394" target="_self"&gt;https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-in-LP-MIP-which-method-is-used-for-detecting-IIS/m-p/495128#M2394&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I am a quantitative researcher but have limit knowledge in OR(this is the first time project),&amp;nbsp;So I didn't really know IIS is for LP (not MILP). Thank you for telling this. I have several addition categorical constraints to add to the model, which I know will cause infeasibility. In addition to your code MILP version, I figured out for LP:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc optmodel presolver=none;

....................
the code your developed;
....................
solve with lp relaxint;/ iis=on;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It seems to stop relaxing constraints;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is another problem, how many nodes are normal? when I add constraint SD, for group 1..3, it worked fine; for group=4, it slowed down a little bit; when group=5, it ran with thousands of nodes and could not give a solution (maybe there wasn't one). I had to stop the program manually. Is there anyway to avoid this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 02:36:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/501315#M2422</guid>
      <dc:creator>Germs</dc:creator>
      <dc:date>2018-10-04T02:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/OR please help with a beginner's code</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/501317#M2423</link>
      <description>Please post the full code that is taking too long.&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Oct 2018 02:43:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/501317#M2423</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2018-10-04T02:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/OR please help with a beginner's code</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/502572#M2425</link>
      <description>&lt;P&gt;Rob, I noticed for this example (in 2-dimension), almost every constraint used "SUM", but if I want to define every single value in a linear program, e.g., pvalue[i]&amp;lt;0.2, how should I create this constraint?&amp;nbsp; Thank you！&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 03:21:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/502572#M2425</guid>
      <dc:creator>Germs</dc:creator>
      <dc:date>2018-10-09T03:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/OR please help with a beginner's code</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/502752#M2427</link>
      <description>&lt;P&gt;I don't quite understand your question.&amp;nbsp; In your program, pvalue[i] is a numeric constant, not a variable.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 15:26:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/502752#M2427</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2018-10-09T15:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/OR please help with a beginner's code</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/502835#M2432</link>
      <description>&lt;P&gt;To say if I want to create a quantitative constraint "choose items from the dataset with pvalue&amp;gt;=0.1" , how should I express this constraint in SAS/OR? This time the question should be clear. Thank you!&lt;/P&gt;&lt;P&gt;All the constraints in this example used "sum", tried a few times but failed.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 18:21:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/502835#M2432</guid>
      <dc:creator>Germs</dc:creator>
      <dc:date>2018-10-09T18:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/OR please help with a beginner's code</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/502840#M2433</link>
      <description>&lt;P&gt;OK, this sounds like the same situation that is addressed in &lt;A href="https://go.documentation.sas.com/?docsetId=ormpug&amp;amp;docsetVersion=14.3&amp;amp;docsetTarget=ormpug_optmodel_examples07.htm&amp;amp;locale=en" target="_self"&gt;this documentation example&lt;/A&gt;.&amp;nbsp; The first approach uses an explicit constraint:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   /* do not assign customer to site more than 30 units away */
   con distance_at_most_30 {i in CUSTOMERS, j in SITES: dist[i,j] &amp;gt; 30}:
      Assign[i,j] = 0;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The second approach (more efficient) instead modifies the index set to avoid creating those variables at all.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 18:32:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/502840#M2433</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2018-10-09T18:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/OR please help with a beginner's code</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/502847#M2434</link>
      <description>&lt;P&gt;I will try it later today to see if I can work it out. SAS/OR is difficult for beginner.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the example. What is the second approach in details?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 18:55:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/502847#M2434</guid>
      <dc:creator>Germs</dc:creator>
      <dc:date>2018-10-09T18:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/OR please help with a beginner's code</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/502960#M2435</link>
      <description>&lt;P&gt;It works for this:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; con pvalueGE{i in pool, j in groups: pvalue[i]&amp;lt;0.1}:
   x[i,j]=0;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 01:32:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-OR-please-help-with-a-beginner-s-code/m-p/502960#M2435</guid>
      <dc:creator>Germs</dc:creator>
      <dc:date>2018-10-10T01:32:30Z</dc:date>
    </item>
  </channel>
</rss>

