<div>&nbsp;</div>
<div>Hi,</div>
<div>&nbsp;</div>
<div>I have written&nbsp;a little piece of my program below, the constraint CostITDevCon2 is causing a problem, I can compile&nbsp;my program without any errors/warnings, but when&nbsp;I run it,&nbsp;&nbsp;the program hangs and I don&#39;t get any message to know what went wrong. When I remove this constraint from the overall program everything works just fine. I think something is seriously wrong with this constraints, don&#39;t know what. Any help on this much appreciated.
</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>#define bigM 10000<br clear="all"></div>
<div>MP_set A(3), I(4), L(3);</div>
<div>&nbsp;</div>
<div>MP_data curLev(A,I), itDevCost(A,I,L)</div>
<div>
<p>MP_constraint CostITDevCon2(A,I)</p>
<p>MP_index li, lj; //alias for set L</p>
<p>MP_variable U(A,I,L), DC(A,I);</p>
<p>DC.lowerLimit(A, I) = 0;</p>
<p>U.binary();</p>
<p>CostITDevCon2(A,I).such_that(curLev(A,I)&gt;=1) = </p>
<p>DC(A,I) &gt;=&nbsp; sum(L(li).such_that(li&gt;curLev(A,I)-1), (1-sum(L(lj).such_that((lj&gt;curLev(A,I)-1) &amp;&amp;<br></p>
<p>(lj&lt;=li)), U(A,I,lj)))*itDevCost(A,I,li)) + bigM*(sum(L.such_that(L&gt;curLev(A,I)-1), U(A,I,L))-1);</p>
<p>The other strange thing is this when I write the above constraint like below, I can&#39;t even compile my program:</p>
<p>CostITDevCon2(A,I).such_that(curLev(A,I)&gt;=1) = </p>
<p>DC(A,I) &gt;=&nbsp; sum(L(li).such_that(li&gt;curLev(A,I)), (1-sum(L(lj).such_that((lj&gt;curLev(A,I)) &amp;&amp;<br></p>
<p>(lj&lt;=li)), U(A,I,lj)))*itDevCost(A,I,li)) + bigM*(sum(L.such_that(L&gt;curLev(A,I)), U(A,I,L))-1);</p>
<p>Here I just remove &quot;-1&quot; from all such_that blocks; everything else is just the same.</p>
<p>For some verification purpose, I rewrote the entire program in GAMS/CPLEX combo and it works just fine over there.</p></div>
<div>curLev(A,I) is the data that contains either 1, 2, or 3.</div>
<div>&nbsp;</div>
<div>best regards,<br>--vishy<br><br>_______________________<br>Youngest Music Meastro<br>Mayank Sahu<br><a href="http://www.mayanksahu.net">http://www.mayanksahu.net</a> </div>