<?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: Conditional Constraint Syntax - Involves Decision Variables in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Conditional-Constraint-Syntax-Involves-Decision-Variables/m-p/167418#M857</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the quick reply. Infact, I have converted the above mentioned proposition into the following constraint. Please excuse my indexing technique. I used different notation for indexes as SAS kept giving me "hides outer declaration"error. My priority was to have a feasible model and then go back and have efficient coding for compression. 1000 is the Big-M and I have bounds for U. U is part of the MTZ subtour elimination. However, the solution is infeasible and I am grinding my teeth debugging the infeasibility. In the routing model that I am developing, I am have a DV "RV" that is indexed over i,j,product,size. In the model the product the truck carries are all unique from each other because the product is an automobile. I have another DV "R" indexed over i,j. While I am getting an optimal route with "R", I am not able to connect RV with R correctly. &lt;/P&gt;&lt;P&gt;example: Civic Medium pickup = Location A dropoff = Location C&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Accord Medium pickup = Location B dropoff = Location C&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I solve the model the "R" DV will correctly traverse the arc to get an optimal route, however the "RV" DV does not. I will see RV[A,B,Civic,medium] = 1 and not RV[A,B,Civic,medium]=1 and RV[B,C,Civic,medium]=1. Have the flow balance constraint but still does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Con New{&amp;lt;f,t,ve,si&amp;gt; in MasterRoute}:&lt;/P&gt;&lt;P&gt;RV[f,t,ve,si] &amp;gt;= 5 - sum{&amp;lt;e,z&amp;gt; in Vehicle:e=ve and z=si} 1 * V[e,z] - sum{&amp;lt;fr,to&amp;gt; in RouteDistance:fr=f and to=t} 1 * R[fr,to] - &lt;/P&gt;&lt;P&gt;sum{&amp;lt;node,vehi,size&amp;gt; in JC:node=f and vehi=ve and size=si} 1* A[node,vehi,size]&lt;/P&gt;&lt;P&gt;- sum{&amp;lt;nod,veh,siz&amp;gt; in JC:nod=t and veh=ve and siz=si} 1 * B[nod, veh,siz] - sum{&amp;lt;bh,ga&amp;gt; in RouteDistance:bh=f and ga=t} 1 * C[bh,ga];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;con New1{&amp;lt;no,ve,si&amp;gt; in JC}:&lt;/P&gt;&lt;P&gt;1000 * (A[no,ve,si] - 1) &amp;lt;= UAll[no] - sum{&amp;lt;nod,veh,siz&amp;gt; in PickUpNode, s in PickSanity:s=nod and nod=no and veh=ve and siz=si} 1 * UAll&lt;S&gt;;&lt;/S&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;con New2{&amp;lt;no,ve,si&amp;gt; in JC}:&lt;/P&gt;&lt;P&gt;1000 * (A[no,ve,si] - 1) &amp;gt;= - UAll[no] + sum{&amp;lt;nod,veh,siz&amp;gt; in PickUpNode, s in PickSanity:s=nod and nod=no and veh=ve and siz=si} 1 * UAll&lt;S&gt;;&lt;/S&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;con New3{&amp;lt;no,ve,si&amp;gt; in JC}:&lt;/P&gt;&lt;P&gt;1000 * (B[no,ve,si] - 1) &amp;lt;= - UAll[no] + sum{&amp;lt;nod,veh,siz&amp;gt; in DropOffNode, s in DropSanity:s=nod and nod=no and veh=ve and siz=si} 1 * UAll&lt;S&gt;;&lt;/S&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;con New4{&amp;lt;no,ve,si&amp;gt; in JC}:&lt;/P&gt;&lt;P&gt;1000 * (B[no,ve,si] - 1) &amp;gt;= UAll[no] - sum{&amp;lt;nod,veh,siz&amp;gt; in DropOffNode, s in DropSanity:s=nod and nod=no and veh=ve and siz=si} 1 * UAll&lt;S&gt;;&lt;/S&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;con New5{&amp;lt;fr,to&amp;gt; in RouteDistance}:&lt;/P&gt;&lt;P&gt;1000 * (C[fr,to] - 1) &amp;lt;= UAll[to] - UAll[fr];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;con New6{&amp;lt;fr,to&amp;gt; in RouteDistance}:&lt;/P&gt;&lt;P&gt;1000 * (C[fr,to] - 1) &amp;gt;= - UAll[to] + UAll[fr];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Feb 2015 03:49:03 GMT</pubDate>
    <dc:creator>V12DBS</dc:creator>
    <dc:date>2015-02-13T03:49:03Z</dc:date>
    <item>
      <title>Conditional Constraint Syntax - Involves Decision Variables</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Conditional-Constraint-Syntax-Involves-Decision-Variables/m-p/167416#M855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a silly question. However not sure if there is an answer to my silly question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am formulating a model where in one of the constraints, for a decision variable to be true, it depends on other decision variables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;for all (&amp;lt;i,j,n&amp;gt; in MasterRoute&amp;gt;&lt;/P&gt;&lt;P&gt;if X&lt;N&gt;=1 and W[i,j]=1 and sum{&amp;lt;nod,(n)&amp;gt; in PickUpNode, p in PickSanity:p=nod and nod=1} U&lt;/N&gt;&lt;/P&gt;&lt;P&gt; &amp;lt;= Ui &amp;lt;= Uj &amp;lt;= Udn then Y[i,j,n]=1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;X, Y, U and Y are decision variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 01:50:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Conditional-Constraint-Syntax-Involves-Decision-Variables/m-p/167416#M855</guid>
      <dc:creator>V12DBS</dc:creator>
      <dc:date>2015-02-13T01:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Constraint Syntax - Involves Decision Variables</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Conditional-Constraint-Syntax-Involves-Decision-Variables/m-p/167417#M856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The proposition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if AND {j in 1..n} (P&lt;J&gt; = 1) then Q = 1,&lt;/J&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where P&lt;J&gt; and Q are binary variables, can be enforced by the linear constraint&lt;/J&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum {j in 1..n} P&lt;J&gt; - n + 1 &amp;lt;= Q.&lt;/J&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming X, W, and Y are binary variables in your problem, you can express the desired proposition in this form by introducing additional binary variables (and big-M constraints) to represent each of the following three propositions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;sum{&amp;lt;nod,(n)&amp;gt; in PickUpNode, p in PickSanity:p=nod and nod=1} U&lt;P&gt; &amp;lt;= Ui&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;Ui &amp;lt;= Uj&lt;/LI&gt;&lt;LI&gt;Uj &amp;lt;= Udn&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have bounds for U?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 03:24:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Conditional-Constraint-Syntax-Involves-Decision-Variables/m-p/167417#M856</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2015-02-13T03:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Constraint Syntax - Involves Decision Variables</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Conditional-Constraint-Syntax-Involves-Decision-Variables/m-p/167418#M857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the quick reply. Infact, I have converted the above mentioned proposition into the following constraint. Please excuse my indexing technique. I used different notation for indexes as SAS kept giving me "hides outer declaration"error. My priority was to have a feasible model and then go back and have efficient coding for compression. 1000 is the Big-M and I have bounds for U. U is part of the MTZ subtour elimination. However, the solution is infeasible and I am grinding my teeth debugging the infeasibility. In the routing model that I am developing, I am have a DV "RV" that is indexed over i,j,product,size. In the model the product the truck carries are all unique from each other because the product is an automobile. I have another DV "R" indexed over i,j. While I am getting an optimal route with "R", I am not able to connect RV with R correctly. &lt;/P&gt;&lt;P&gt;example: Civic Medium pickup = Location A dropoff = Location C&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Accord Medium pickup = Location B dropoff = Location C&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I solve the model the "R" DV will correctly traverse the arc to get an optimal route, however the "RV" DV does not. I will see RV[A,B,Civic,medium] = 1 and not RV[A,B,Civic,medium]=1 and RV[B,C,Civic,medium]=1. Have the flow balance constraint but still does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Con New{&amp;lt;f,t,ve,si&amp;gt; in MasterRoute}:&lt;/P&gt;&lt;P&gt;RV[f,t,ve,si] &amp;gt;= 5 - sum{&amp;lt;e,z&amp;gt; in Vehicle:e=ve and z=si} 1 * V[e,z] - sum{&amp;lt;fr,to&amp;gt; in RouteDistance:fr=f and to=t} 1 * R[fr,to] - &lt;/P&gt;&lt;P&gt;sum{&amp;lt;node,vehi,size&amp;gt; in JC:node=f and vehi=ve and size=si} 1* A[node,vehi,size]&lt;/P&gt;&lt;P&gt;- sum{&amp;lt;nod,veh,siz&amp;gt; in JC:nod=t and veh=ve and siz=si} 1 * B[nod, veh,siz] - sum{&amp;lt;bh,ga&amp;gt; in RouteDistance:bh=f and ga=t} 1 * C[bh,ga];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;con New1{&amp;lt;no,ve,si&amp;gt; in JC}:&lt;/P&gt;&lt;P&gt;1000 * (A[no,ve,si] - 1) &amp;lt;= UAll[no] - sum{&amp;lt;nod,veh,siz&amp;gt; in PickUpNode, s in PickSanity:s=nod and nod=no and veh=ve and siz=si} 1 * UAll&lt;S&gt;;&lt;/S&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;con New2{&amp;lt;no,ve,si&amp;gt; in JC}:&lt;/P&gt;&lt;P&gt;1000 * (A[no,ve,si] - 1) &amp;gt;= - UAll[no] + sum{&amp;lt;nod,veh,siz&amp;gt; in PickUpNode, s in PickSanity:s=nod and nod=no and veh=ve and siz=si} 1 * UAll&lt;S&gt;;&lt;/S&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;con New3{&amp;lt;no,ve,si&amp;gt; in JC}:&lt;/P&gt;&lt;P&gt;1000 * (B[no,ve,si] - 1) &amp;lt;= - UAll[no] + sum{&amp;lt;nod,veh,siz&amp;gt; in DropOffNode, s in DropSanity:s=nod and nod=no and veh=ve and siz=si} 1 * UAll&lt;S&gt;;&lt;/S&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;con New4{&amp;lt;no,ve,si&amp;gt; in JC}:&lt;/P&gt;&lt;P&gt;1000 * (B[no,ve,si] - 1) &amp;gt;= UAll[no] - sum{&amp;lt;nod,veh,siz&amp;gt; in DropOffNode, s in DropSanity:s=nod and nod=no and veh=ve and siz=si} 1 * UAll&lt;S&gt;;&lt;/S&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;con New5{&amp;lt;fr,to&amp;gt; in RouteDistance}:&lt;/P&gt;&lt;P&gt;1000 * (C[fr,to] - 1) &amp;lt;= UAll[to] - UAll[fr];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;con New6{&amp;lt;fr,to&amp;gt; in RouteDistance}:&lt;/P&gt;&lt;P&gt;1000 * (C[fr,to] - 1) &amp;gt;= - UAll[to] + UAll[fr];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 03:49:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Conditional-Constraint-Syntax-Involves-Decision-Variables/m-p/167418#M857</guid>
      <dc:creator>V12DBS</dc:creator>
      <dc:date>2015-02-13T03:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Constraint Syntax - Involves Decision Variables</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Conditional-Constraint-Syntax-Involves-Decision-Variables/m-p/167419#M858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It will help me understand better if you write the desired logical relationship among V, R, A, B, C, and RV as a proposition using IF, THEN, AND, OR, and NOT, without the indexing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 04:33:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Conditional-Constraint-Syntax-Involves-Decision-Variables/m-p/167419#M858</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2015-02-13T04:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Constraint Syntax - Involves Decision Variables</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Conditional-Constraint-Syntax-Involves-Decision-Variables/m-p/167420#M859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suspect that you want to enforce the following proposition:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if V = 1 and R = 1 and A = 1 and B = 1 and C = 1 then RV = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The corresponding linear constraint would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;V + R + A + B + C - 4 &amp;lt;= RV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you currently have (Con New):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;V + R + A + B + C + RV &amp;gt;= 5&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 19:38:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Conditional-Constraint-Syntax-Involves-Decision-Variables/m-p/167420#M859</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2015-02-13T19:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Constraint Syntax - Involves Decision Variables</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Conditional-Constraint-Syntax-Involves-Decision-Variables/m-p/167421#M860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Apologies for the delay.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;V = Vehicle DV. Indexed over AutoID and Size. Type = Binary.&lt;/P&gt;&lt;P&gt;R = Arc DV. Indexed over I &amp;amp; J. Type = Binary&lt;/P&gt;&lt;P&gt;A = Visit Node. Indexed over I, AutoID and Size, Type = Binary&lt;/P&gt;&lt;P&gt;B = Visit Node. Indexed over J, AutoID and Size. Type = Binary&lt;/P&gt;&lt;P&gt;RV = Arc with AutoID. Indexed over I, J, AutoID and Size. Type = Binary&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My main goal is to make sure that I carry my Automobile that is on a truck from it's pickup all the way to dropoff (while visiting transition nodes for other automobile pickup)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So If I select to carry(V) an Automobile and pass through an arc (R) and the arc's I th node and J th node than RV = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for checking my constraint. I dont think I need the C though. However, The new2...new6 constraints that I have after the &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;V + R + A + B + C + RV &amp;gt;= 5, seems to be the problem. Or probably I have something formulated in the model elsewhere that is causing the model's infeasibility. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 19:54:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Conditional-Constraint-Syntax-Involves-Decision-Variables/m-p/167421#M860</guid>
      <dc:creator>V12DBS</dc:creator>
      <dc:date>2015-02-13T19:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Constraint Syntax - Involves Decision Variables</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Conditional-Constraint-Syntax-Involves-Decision-Variables/m-p/167422#M861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then I think you want&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;V + R + A + B - 3 &amp;lt;= RV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead of your current Con New.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that change doesn't correct the issue, you might try fixing variables to a known feasible solution, call the solver, and see which constraints are flagged as infeasible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 20:03:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Conditional-Constraint-Syntax-Involves-Decision-Variables/m-p/167422#M861</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2015-02-13T20:03:48Z</dc:date>
    </item>
  </channel>
</rss>

