<?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 Constraint in optimization model in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Constraint-in-optimization-model/m-p/527679#M2544</link>
    <description>&lt;P&gt;I have a dataset having item_id as a column, where item_id ranges from 1 to 10, i want to select some of them based on some constraints in the optimization model. I defined a binary variable Yi={0,1} to decide which are selected and which not based on other constarints.&lt;BR /&gt;Now I have another dataset, having 2 columns item_id1 and item_id2, both have item ids from 1 to 10 only.&lt;BR /&gt;Eg dataset:&lt;/P&gt;&lt;P&gt;Item_id1&amp;nbsp; Item_id2&lt;BR /&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;and so on&lt;BR /&gt;&lt;BR /&gt;Now, i have to impose 1 more constraint that if any value from item_id1 is selected, then corresponding value from item_id2 is also selected, else both are not selected. In other words, if 1 is getting selected, then 2 is also selected. If 2 is getting selected, then 5 is also getting selected.&lt;/P&gt;&lt;P&gt;And i want to do that using only 1 binary variable Yi, to write that as a constaraint in the optimization model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Jan 2019 11:11:39 GMT</pubDate>
    <dc:creator>Ayush_sas</dc:creator>
    <dc:date>2019-01-16T11:11:39Z</dc:date>
    <item>
      <title>Constraint in optimization model</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Constraint-in-optimization-model/m-p/527679#M2544</link>
      <description>&lt;P&gt;I have a dataset having item_id as a column, where item_id ranges from 1 to 10, i want to select some of them based on some constraints in the optimization model. I defined a binary variable Yi={0,1} to decide which are selected and which not based on other constarints.&lt;BR /&gt;Now I have another dataset, having 2 columns item_id1 and item_id2, both have item ids from 1 to 10 only.&lt;BR /&gt;Eg dataset:&lt;/P&gt;&lt;P&gt;Item_id1&amp;nbsp; Item_id2&lt;BR /&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;and so on&lt;BR /&gt;&lt;BR /&gt;Now, i have to impose 1 more constraint that if any value from item_id1 is selected, then corresponding value from item_id2 is also selected, else both are not selected. In other words, if 1 is getting selected, then 2 is also selected. If 2 is getting selected, then 5 is also getting selected.&lt;/P&gt;&lt;P&gt;And i want to do that using only 1 binary variable Yi, to write that as a constaraint in the optimization model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 11:11:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Constraint-in-optimization-model/m-p/527679#M2544</guid>
      <dc:creator>Ayush_sas</dc:creator>
      <dc:date>2019-01-16T11:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Constraint in optimization model</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Constraint-in-optimization-model/m-p/528088#M2545</link>
      <description>&lt;P&gt;You can linearize an if-then implication like yours by imposing a constraint Yi[i] &amp;lt;= Yi[j].&amp;nbsp; A left-hand side of 1 forces the right-hand side to be 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For several examples like this, follow the first item ("binary variables, modeling if-then constraints") in the Subject Index in this documentation book:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/api/docsets/ormpex/15.1/content/ormpex.pdf?locale=en#nameddest=titlepage" target="_blank"&gt;https://go.documentation.sas.com/api/docsets/ormpex/15.1/content/ormpex.pdf?locale=en#nameddest=titlepage&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 16:31:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Constraint-in-optimization-model/m-p/528088#M2545</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2019-01-17T16:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: Constraint in optimization model</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Constraint-in-optimization-model/m-p/546373#M2624</link>
      <description>Thanks a lot Rob!!</description>
      <pubDate>Wed, 27 Mar 2019 04:06:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Constraint-in-optimization-model/m-p/546373#M2624</guid>
      <dc:creator>Ayush_sas</dc:creator>
      <dc:date>2019-03-27T04:06:05Z</dc:date>
    </item>
  </channel>
</rss>

