<?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 SAS Optimization Model in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-Optimization-Model/m-p/322898#M1625</link>
    <description>&lt;P&gt;Hi, I am trying to write a code for a transshipment procurement model from 4 plants (Ps) via 3 transshipment nodes (Ts) to 4 destination distribution centers (DCs).&amp;nbsp;&lt;/P&gt;&lt;P&gt;The conditon is that each node in the&amp;nbsp;inflow (from Ps to Ts) and outflow (from Ts to Ds) variables need to be a multiple of 3.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to do that via introducing the "lot" variable, however it doesn't work correctly when I use lot =3, but it does give a correct answer when lot size = 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone kindly, help point out the mistake I am making. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Current Code -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc optmodel;							
set Ps ={'P1', 'P2', 'P3', 'P4'};							
set Ds ={'D1', 'D2', 'D3', 'D4'};							
set Ts ={'T1', 'T2', 'T3'};							
number InCost{Ps, Ts} = [							
39	29	43					
40	35	43					
48	44	31					
37	39	30];					
number OutCost{Ts, Ds} = [							
34	17	36	25				
30	47	16	15				
29	22	21	23];				
number Supply{Ps} = [37	34	20	28];				
number Demand{Ds} = [18	15	21	3];				
number TransshipmentCapacity {Ts} = [37	37	43];					
number TransshipmentFixedCost{Ts} = [700	700	900];					
number ProductionFixedCost{Ps} = [420	120	240	580];				
var inflow {Ps, Ts} integer&amp;gt;=0;							
var outflow{Ts, Ds} integer&amp;gt;=0;							
number lot = 1;							
var y{Ts} binary;							
var a{Ps} binary;							
number M=1000000;							
number N=1000000;							
minimize Z = sum{i in Ps}sum{j in Ts}(inflow[i,j]*lot)*InCost[i,j]+sum{j in Ts}y[j]*TransshipmentFixedCost[j]							
+sum{i in Ps}a[i]*ProductionFixedCost[i]+sum{j in Ts}sum{k in Ds}(outflow[j,k]*lot)*OutCost[j,k];							
con SupplyConst {i in Ps}:sum{j in Ts}(inflow[i,j]*lot)  &amp;lt;= Supply[i];							
con DemandConst {k in Ds}:sum{j in Ts}(outflow[j,k]*lot) &amp;gt;= Demand[k];							
con NoStockConst{j in Ts}:sum{i in Ps}(inflow[i,j]*lot) = sum{k in Ds}(outflow[j,k]*lot);							
con TsCapConst  {j in Ts}:sum{i in Ps}(inflow[i,j]*lot) &amp;lt;= TransshipmentCapacity[j];							
con linkingy {j in Ts}:sum{i in Ps}(inflow[i,j]*lot)&amp;lt;=M*y[j];							
con linkinga {i in Ps}:sum{j in Ts}(inflow[i,j]*lot)&amp;lt;=N*a[i];							
solve;							
print inflow;							
print outflow;							
print y;							
print a;							
print Z;							
print {j in Ts} (sum{i in Ps}inflow[i,j]);							
print {j in Ts} (sum{k in Ds}outflow[j,k]);							
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 06 Jan 2017 06:13:49 GMT</pubDate>
    <dc:creator>84</dc:creator>
    <dc:date>2017-01-06T06:13:49Z</dc:date>
    <item>
      <title>SAS Optimization Model</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-Optimization-Model/m-p/322898#M1625</link>
      <description>&lt;P&gt;Hi, I am trying to write a code for a transshipment procurement model from 4 plants (Ps) via 3 transshipment nodes (Ts) to 4 destination distribution centers (DCs).&amp;nbsp;&lt;/P&gt;&lt;P&gt;The conditon is that each node in the&amp;nbsp;inflow (from Ps to Ts) and outflow (from Ts to Ds) variables need to be a multiple of 3.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to do that via introducing the "lot" variable, however it doesn't work correctly when I use lot =3, but it does give a correct answer when lot size = 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone kindly, help point out the mistake I am making. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Current Code -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc optmodel;							
set Ps ={'P1', 'P2', 'P3', 'P4'};							
set Ds ={'D1', 'D2', 'D3', 'D4'};							
set Ts ={'T1', 'T2', 'T3'};							
number InCost{Ps, Ts} = [							
39	29	43					
40	35	43					
48	44	31					
37	39	30];					
number OutCost{Ts, Ds} = [							
34	17	36	25				
30	47	16	15				
29	22	21	23];				
number Supply{Ps} = [37	34	20	28];				
number Demand{Ds} = [18	15	21	3];				
number TransshipmentCapacity {Ts} = [37	37	43];					
number TransshipmentFixedCost{Ts} = [700	700	900];					
number ProductionFixedCost{Ps} = [420	120	240	580];				
var inflow {Ps, Ts} integer&amp;gt;=0;							
var outflow{Ts, Ds} integer&amp;gt;=0;							
number lot = 1;							
var y{Ts} binary;							
var a{Ps} binary;							
number M=1000000;							
number N=1000000;							
minimize Z = sum{i in Ps}sum{j in Ts}(inflow[i,j]*lot)*InCost[i,j]+sum{j in Ts}y[j]*TransshipmentFixedCost[j]							
+sum{i in Ps}a[i]*ProductionFixedCost[i]+sum{j in Ts}sum{k in Ds}(outflow[j,k]*lot)*OutCost[j,k];							
con SupplyConst {i in Ps}:sum{j in Ts}(inflow[i,j]*lot)  &amp;lt;= Supply[i];							
con DemandConst {k in Ds}:sum{j in Ts}(outflow[j,k]*lot) &amp;gt;= Demand[k];							
con NoStockConst{j in Ts}:sum{i in Ps}(inflow[i,j]*lot) = sum{k in Ds}(outflow[j,k]*lot);							
con TsCapConst  {j in Ts}:sum{i in Ps}(inflow[i,j]*lot) &amp;lt;= TransshipmentCapacity[j];							
con linkingy {j in Ts}:sum{i in Ps}(inflow[i,j]*lot)&amp;lt;=M*y[j];							
con linkinga {i in Ps}:sum{j in Ts}(inflow[i,j]*lot)&amp;lt;=N*a[i];							
solve;							
print inflow;							
print outflow;							
print y;							
print a;							
print Z;							
print {j in Ts} (sum{i in Ps}inflow[i,j]);							
print {j in Ts} (sum{k in Ds}outflow[j,k]);							
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Jan 2017 06:13:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-Optimization-Model/m-p/322898#M1625</guid>
      <dc:creator>84</dc:creator>
      <dc:date>2017-01-06T06:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Optimization Model</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-Optimization-Model/m-p/322927#M1626</link>
      <description>&lt;P&gt;Please post it at OR forum .&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2017 10:23:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-Optimization-Model/m-p/322927#M1626</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-01-06T10:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Optimization Model</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-Optimization-Model/m-p/323158#M1627</link>
      <description>&lt;P&gt;Ksharp..can u please share the link of the OR forum here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2017 16:14:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-Optimization-Model/m-p/323158#M1627</guid>
      <dc:creator>84</dc:creator>
      <dc:date>2017-01-07T16:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Optimization Model</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-Optimization-Model/m-p/323220#M1628</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;: as  Super User, you have the power to move it there &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Sun, 08 Jan 2017 15:36:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-Optimization-Model/m-p/323220#M1628</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-01-08T15:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Optimization Model</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-Optimization-Model/m-p/325093#M1629</link>
      <description>&lt;P&gt;See &lt;A href="https://communities.sas.com/t5/Mathematical-Optimization/Please-help-in-below-facility-location-code/td-p/315424" target="_self"&gt;this recent thread&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 18:43:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-Optimization-Model/m-p/325093#M1629</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2017-01-16T18:43:35Z</dc:date>
    </item>
  </channel>
</rss>

