<?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: How to define product of sets in optmodel in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/How-to-define-product-of-sets-in-optmodel/m-p/316786#M1560</link>
    <description>&lt;P&gt;Thank you! It was a very good example. The only question I have is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this example variables assign is binary :&lt;/P&gt;&lt;PRE class="xis-codeBlock"&gt;var Assign {DEPTS, CITIES} binary;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;and variable product is defined as binary&amp;nbsp;too&lt;/P&gt;&lt;PRE class="xis-codeBlock"&gt;var Product {IJKL} binary;&lt;BR /&gt;con Product_def {&amp;lt;i,j,k,l&amp;gt; in IJKL}: Assign[i,j] + Assign[k,l] - 1 &amp;lt;= Product[i,j,k,l];&lt;BR /&gt;con Product_def2 {&amp;lt;i,j,k,l&amp;gt; in IJKL}: Product[i,j,k,l] &amp;lt;= Assign[i,j]; &lt;BR /&gt;con Product_def3 {&amp;lt;i,j,k,l&amp;gt; in IJKL}: Product[i,j,k,l] &amp;lt;= Assign[k,l];&lt;/PRE&gt;&lt;P&gt;I think we dont need to define "product"&amp;nbsp;as binary since based on the constraint I see here it automaticlly gets 1 and zero, is this correct?&lt;/P&gt;</description>
    <pubDate>Mon, 05 Dec 2016 17:19:25 GMT</pubDate>
    <dc:creator>Afdoone</dc:creator>
    <dc:date>2016-12-05T17:19:25Z</dc:date>
    <item>
      <title>How to define product of sets in optmodel</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/How-to-define-product-of-sets-in-optmodel/m-p/316771#M1558</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my optmodel, I have a binary variable which is defined on a set with 3 elements(c,d,v) as: P{c,d,v}&lt;/P&gt;&lt;P&gt;I have another continous variable as x{c,d,v1,v2} which gives me 1 if &lt;SPAN&gt;P{c,d,v1}=1 and&amp;nbsp;P{c,d,v2}=1 and 0 if one of them not&lt;/SPAN&gt;&amp;nbsp;, I defined it as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;con variable_3{&amp;lt;&lt;SPAN&gt;c,d,v1,v2&lt;/SPAN&gt;&amp;gt; in set3}:&lt;BR /&gt;&lt;SPAN&gt;x&lt;/SPAN&gt;[&lt;SPAN&gt;c,d,v1,v2&lt;/SPAN&gt;] = P[c,d,v1]*P[c,d,v2]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I did is: I built a big table which has all the combination of v1 and v2 as set3, this makes my problem huge and out of memory. I was wondering about these questions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Does it make a difference if I use impvar instead of the constraint for the memory issue&lt;/P&gt;&lt;P&gt;2. I suspect that we can define set3 directly in the opmodel as a product of two other sets without generating a big table as a combination of v1 and v2. Can somebody help me if there is a way to do that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 16:42:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/How-to-define-product-of-sets-in-optmodel/m-p/316771#M1558</guid>
      <dc:creator>Afdoone</dc:creator>
      <dc:date>2016-12-05T16:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to define product of sets in optmodel</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/How-to-define-product-of-sets-in-optmodel/m-p/316777#M1559</link>
      <description>&lt;P&gt;You are asking about a product of binary variables, not a product of sets.&amp;nbsp; See&amp;nbsp;&lt;A href="http://go.documentation.sas.com/#!/?docsetId=ormpex&amp;amp;docsetTarget=ormpex_ex10_toc.htm&amp;amp;docsetVersion=14.2&amp;amp;locale=en" target="_self"&gt;this doc example&lt;/A&gt; that illustrates how to linearize this product.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 16:56:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/How-to-define-product-of-sets-in-optmodel/m-p/316777#M1559</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2016-12-05T16:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to define product of sets in optmodel</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/How-to-define-product-of-sets-in-optmodel/m-p/316786#M1560</link>
      <description>&lt;P&gt;Thank you! It was a very good example. The only question I have is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this example variables assign is binary :&lt;/P&gt;&lt;PRE class="xis-codeBlock"&gt;var Assign {DEPTS, CITIES} binary;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;and variable product is defined as binary&amp;nbsp;too&lt;/P&gt;&lt;PRE class="xis-codeBlock"&gt;var Product {IJKL} binary;&lt;BR /&gt;con Product_def {&amp;lt;i,j,k,l&amp;gt; in IJKL}: Assign[i,j] + Assign[k,l] - 1 &amp;lt;= Product[i,j,k,l];&lt;BR /&gt;con Product_def2 {&amp;lt;i,j,k,l&amp;gt; in IJKL}: Product[i,j,k,l] &amp;lt;= Assign[i,j]; &lt;BR /&gt;con Product_def3 {&amp;lt;i,j,k,l&amp;gt; in IJKL}: Product[i,j,k,l] &amp;lt;= Assign[k,l];&lt;/PRE&gt;&lt;P&gt;I think we dont need to define "product"&amp;nbsp;as binary since based on the constraint I see here it automaticlly gets 1 and zero, is this correct?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 17:19:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/How-to-define-product-of-sets-in-optmodel/m-p/316786#M1560</guid>
      <dc:creator>Afdoone</dc:creator>
      <dc:date>2016-12-05T17:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to define product of sets in optmodel</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/How-to-define-product-of-sets-in-optmodel/m-p/316790#M1561</link>
      <description>&lt;P&gt;Glad to help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, you can relax the new variable, and this idea is mentioned in the doc&amp;nbsp;example:&lt;/P&gt;
&lt;P&gt;"In both formulations, the &lt;CODE class="aa-varname"&gt;Product&lt;/CODE&gt; variable can be relaxed to be nonnegative instead of binary. The integrality of &lt;CODE class="aa-varname"&gt;Assign&lt;/CODE&gt;, together with the various Product_def* constraints, automatically implies integrality of &lt;CODE class="aa-varname"&gt;Product&lt;/CODE&gt;. For real-world problems, you should try both ways to determine which alternative performs better in specific cases."&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 17:27:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/How-to-define-product-of-sets-in-optmodel/m-p/316790#M1561</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2016-12-05T17:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to define product of sets in optmodel</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/How-to-define-product-of-sets-in-optmodel/m-p/316791#M1562</link>
      <description>Perfect! Thank you so much!</description>
      <pubDate>Mon, 05 Dec 2016 17:29:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/How-to-define-product-of-sets-in-optmodel/m-p/316791#M1562</guid>
      <dc:creator>Afdoone</dc:creator>
      <dc:date>2016-12-05T17:29:01Z</dc:date>
    </item>
  </channel>
</rss>

