<?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: PROC OPTLSO: strategies to find global optimum in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/PROC-OPTLSO-strategies-to-find-global-optimum/m-p/320395#M1602</link>
    <description>&lt;P&gt;Though PROC OPTLSO does conduct a global search of the feasible region using a GA and LHS, it does not currently attempt to calculate a global optimality certificate such as one might find in a branch and bound algorithm.&amp;nbsp; Typically the computation of such certificates either require much stronger assumptions on the objective and constraint functions and/or significantly longer running time.&amp;nbsp; So unfortunately there is no way to guarantee the returned point is globally optimal.&amp;nbsp; However, there are many things we can try to increase the probability that a global optimal point is found such as increasing popsize, nlocal, and/or nglobal, as you suggest. In general I have found that increasing popsize tends to be preferrable, but as you pointed out it is not guaranteed to improve the objective.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use seed=0, a random seed will be generated each time. &amp;nbsp;One possibility is to run with (or without) seed=0 and perform a small grid search over a set of popsizes (something similar could be added to search on nglobal/nlocal). &amp;nbsp;For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let popsize=200;
%macro loopSolve(ntimes);
proc delete data=pall;
%do i=1 %to &amp;amp;ntimes.;
   %let popsize = %eval(&amp;amp;popsize. + 10*&amp;amp;i.); 
   proc optlso   &lt;BR /&gt;      /* your other options here */
      popsize=&amp;amp;popsize.
      seed=0   
      primalout=pout;  
      performance nthreads=2;
   run;
   
   data pout;
     set pout;
     _sol_=&amp;amp;i.;
   run;

   proc append base=pall data=pout;
   run; 
%end;
 
%mend;
 
%loopSolve(10);

proc transpose data=pall out=pallrow (drop=_label_ _name_);
    by _sol_;
    var _value_;
    id _id_;  
 run;  

 proc print data=pallrow;
 run;
&lt;/PRE&gt;
&lt;P&gt;I've attached a documentation example using the above code. &amp;nbsp;Hopefully this help and please let us know if you have more questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Josh&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Dec 2016 02:57:57 GMT</pubDate>
    <dc:creator>joshgriffin</dc:creator>
    <dc:date>2016-12-21T02:57:57Z</dc:date>
    <item>
      <title>PROC OPTLSO: strategies to find global optimum</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/PROC-OPTLSO-strategies-to-find-global-optimum/m-p/320214#M1601</link>
      <description>&lt;P&gt;Firstly Kudos to SAS team for providing the wonderful procedure for general optimization (single and multiobjective) procedure&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Proc OPTLSO&lt;/FONT&gt;. I have worked in almost all software, this procedure&amp;nbsp;seems to be the most powerful and general solver that I know of.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a hard nonlinear and nonsmooth opbjective function with linear and nonlinear constraints. The true global optimum for my problem is 26.35. However&amp;nbsp;&lt;FONT face="courier new,courier"&gt;proc optlso&lt;/FONT&gt; returns 27.45. When I change the population size from 300 to 250, I get the true optimum of 26.35. When I change the population size to 200 I dont get the optimal solution. Here are my questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;What is the best strategy to get global optimum "every" time when I run the program ? Is there a best practice ? Changing population size I'm assuming is not ideal.&lt;/LI&gt;
&lt;LI&gt;How o set the &lt;FONT face="courier new,courier"&gt;seed&lt;/FONT&gt; to random number generator based on clock or something like it ? Will this improve chances of getting the global optimum ? Default seed is 1, I would like to change the seed every time a global solver is started.&lt;/LI&gt;
&lt;LI&gt;Would increasing &lt;FONT face="courier new,courier"&gt;nglobal&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;nlocal&lt;/FONT&gt; help improve the chance of getting global optimum ?&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc optlso
	ABSFCONV= 1e-20
   	primalout = solution
   	variables = vardata
   	lincon    = lindata
	nlincon   = condata
	objective = objdata
	POPSIZE = 300
    logfreq = 50
	NGLOBAL = 20
	nlocal = 20
	;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 14:35:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/PROC-OPTLSO-strategies-to-find-global-optimum/m-p/320214#M1601</guid>
      <dc:creator>Forecaster</dc:creator>
      <dc:date>2016-12-20T14:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: PROC OPTLSO: strategies to find global optimum</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/PROC-OPTLSO-strategies-to-find-global-optimum/m-p/320395#M1602</link>
      <description>&lt;P&gt;Though PROC OPTLSO does conduct a global search of the feasible region using a GA and LHS, it does not currently attempt to calculate a global optimality certificate such as one might find in a branch and bound algorithm.&amp;nbsp; Typically the computation of such certificates either require much stronger assumptions on the objective and constraint functions and/or significantly longer running time.&amp;nbsp; So unfortunately there is no way to guarantee the returned point is globally optimal.&amp;nbsp; However, there are many things we can try to increase the probability that a global optimal point is found such as increasing popsize, nlocal, and/or nglobal, as you suggest. In general I have found that increasing popsize tends to be preferrable, but as you pointed out it is not guaranteed to improve the objective.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use seed=0, a random seed will be generated each time. &amp;nbsp;One possibility is to run with (or without) seed=0 and perform a small grid search over a set of popsizes (something similar could be added to search on nglobal/nlocal). &amp;nbsp;For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let popsize=200;
%macro loopSolve(ntimes);
proc delete data=pall;
%do i=1 %to &amp;amp;ntimes.;
   %let popsize = %eval(&amp;amp;popsize. + 10*&amp;amp;i.); 
   proc optlso   &lt;BR /&gt;      /* your other options here */
      popsize=&amp;amp;popsize.
      seed=0   
      primalout=pout;  
      performance nthreads=2;
   run;
   
   data pout;
     set pout;
     _sol_=&amp;amp;i.;
   run;

   proc append base=pall data=pout;
   run; 
%end;
 
%mend;
 
%loopSolve(10);

proc transpose data=pall out=pallrow (drop=_label_ _name_);
    by _sol_;
    var _value_;
    id _id_;  
 run;  

 proc print data=pallrow;
 run;
&lt;/PRE&gt;
&lt;P&gt;I've attached a documentation example using the above code. &amp;nbsp;Hopefully this help and please let us know if you have more questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Josh&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 02:57:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/PROC-OPTLSO-strategies-to-find-global-optimum/m-p/320395#M1602</guid>
      <dc:creator>joshgriffin</dc:creator>
      <dc:date>2016-12-21T02:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: PROC OPTLSO: strategies to find global optimum</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/PROC-OPTLSO-strategies-to-find-global-optimum/m-p/320493#M1603</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/59799"&gt;@joshgriffin&lt;/a&gt;&amp;nbsp;Thank you very much, setting seed=0 and running the program multiple times did the trick. I really appreciate your quick response.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 13:29:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/PROC-OPTLSO-strategies-to-find-global-optimum/m-p/320493#M1603</guid>
      <dc:creator>Forecaster</dc:creator>
      <dc:date>2016-12-21T13:29:17Z</dc:date>
    </item>
  </channel>
</rss>

