<?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: Constraints with &amp;quot;not in&amp;quot; clause in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Constraints-with-quot-not-in-quot-clause/m-p/631110#M3036</link>
    <description>&lt;P&gt;If you really want just one constraint, here are two ways:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;con DC_LSP_NoSAVLAX:
   sum{c in LSP, d in DC: d not in {'SAV,'LAX'}} IsLSPDC[c,d] = DC_LSPs;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;con DC_LSP_NoSAVLAX:
   sum{c in LSP, d in DC diff {'SAV,'LAX'}} IsLSPDC[c,d] = DC_LSPs;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If instead you want a family of constraints indexed by d, here are two ways:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;con DC_LSP_NoSAVLAX {d in DC: d not in {'SAV,'LAX'}}:
   sum{c in LSP} IsLSPDC[c,d] = DC_LSPs;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;con DC_LSP_NoSAVLAX {d in DC diff {'SAV,'LAX'}}:
   sum{c in LSP} IsLSPDC[c,d] = DC_LSPs;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 10 Mar 2020 21:25:28 GMT</pubDate>
    <dc:creator>RobPratt</dc:creator>
    <dc:date>2020-03-10T21:25:28Z</dc:date>
    <item>
      <title>Constraints with "not in" clause</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Constraints-with-quot-not-in-quot-clause/m-p/631097#M3034</link>
      <description>&lt;P&gt;This constraint forces that a DC is served by exactly "x" number of LSPs.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Constraint for retricting DC-LSP: given DC can by served by "x" number of LSPs*/
num DC_LSPs=5;
con DC_LSP: sum{c in LSP} IsLSPDC[c,'LAX'] = DC_LSPs;
con DC_LSP_Link1{p in Ports, t in Transit,c in lsp, d in {'LAX'}}:
ContainersfromPortstoLSPtoDC[p,t,c,'AL1'] &amp;lt;= BigM * IsLSPDC[C,'LAX'];
con DC_LSPLink2{c in LSP, d in DC}:
sum {p in Ports, t in Transit} ContainersfromPortstoLSPtoDC[p,t,c,d] &amp;gt;= IsLSPDC[c,d];&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This works fine. Now I want to have another constraint where I want to follow the same logic but want to limit my choice of DC to anything that is not in ('LAX','SAV'). So am looking to write sthg like&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;con DC_LSP_NoSAVLAX: sum{c in LSP} IsLSPDC[c,not in ('SAV,'LAX')] = DC_LSPs;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Can i do that? If yes what would be the correct syntax.&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;</description>
      <pubDate>Tue, 10 Mar 2020 21:15:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Constraints-with-quot-not-in-quot-clause/m-p/631097#M3034</guid>
      <dc:creator>Santha</dc:creator>
      <dc:date>2020-03-10T21:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: Constraints with "not in" clause</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Constraints-with-quot-not-in-quot-clause/m-p/631110#M3036</link>
      <description>&lt;P&gt;If you really want just one constraint, here are two ways:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;con DC_LSP_NoSAVLAX:
   sum{c in LSP, d in DC: d not in {'SAV,'LAX'}} IsLSPDC[c,d] = DC_LSPs;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;con DC_LSP_NoSAVLAX:
   sum{c in LSP, d in DC diff {'SAV,'LAX'}} IsLSPDC[c,d] = DC_LSPs;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If instead you want a family of constraints indexed by d, here are two ways:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;con DC_LSP_NoSAVLAX {d in DC: d not in {'SAV,'LAX'}}:
   sum{c in LSP} IsLSPDC[c,d] = DC_LSPs;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;con DC_LSP_NoSAVLAX {d in DC diff {'SAV,'LAX'}}:
   sum{c in LSP} IsLSPDC[c,d] = DC_LSPs;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Mar 2020 21:25:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Constraints-with-quot-not-in-quot-clause/m-p/631110#M3036</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2020-03-10T21:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: Constraints with "not in" clause</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Constraints-with-quot-not-in-quot-clause/m-p/631123#M3037</link>
      <description>&lt;P&gt;the constraint worked.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the second constraint that I changed to this. But i get syntax errors.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;con DC_LSP_Direct_Link1{p in Ports, t in Transit,c in lsp, d not in {'SAV','LAX'}}:&lt;BR /&gt;ContainersfromPortstoLSPtoDC[p,t,c,d not in {'SAV','LAX'}] &amp;lt;= BigM * IsLSPDC[c,d not in {'SAV','LAX'}];&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 22:31:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Constraints-with-quot-not-in-quot-clause/m-p/631123#M3037</guid>
      <dc:creator>Santha</dc:creator>
      <dc:date>2020-03-10T22:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Constraints with "not in" clause</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Constraints-with-quot-not-in-quot-clause/m-p/631124#M3038</link>
      <description>&lt;P&gt;I think i know why&amp;nbsp; . let me try the fix&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 22:33:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Constraints-with-quot-not-in-quot-clause/m-p/631124#M3038</guid>
      <dc:creator>Santha</dc:creator>
      <dc:date>2020-03-10T22:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Constraints with "not in" clause</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Constraints-with-quot-not-in-quot-clause/m-p/631126#M3039</link>
      <description>&lt;P&gt;I tried this. still got error:&lt;/P&gt;&lt;P&gt;con DC_LSP_Direct_Link1{p in Ports, t in Transit,c in lsp, d in DC: d not in {'SAV','LAX'}}:&lt;BR /&gt;ContainersfromPortstoLSPtoDC[p,t,c,d in DC: d not in {'SAV','LAX'}] &amp;lt;= BigM * IsLSPDC[c,d in DC: d not in {'SAV','LAX'}];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 22:44:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Constraints-with-quot-not-in-quot-clause/m-p/631126#M3039</guid>
      <dc:creator>Santha</dc:creator>
      <dc:date>2020-03-10T22:44:04Z</dc:date>
    </item>
  </channel>
</rss>

