Thank for the answer, i figured it would be more complicatedi (insert the elements to the set "ac"), but it was easy <br> <br>MP_subset<2> ab(A,B), bc(B,C), ac(A,C);<br> ab.insert(12,780); ab.insert(30,780);
ab.insert(41,782); . . .<br> bc.insert(780,170); bc.insert(780,140); bc.insert(782,154); . . .<br>forall( ab(a,b)*bc(b,c), ac.insert(a,c));<br>MP_binary_variable Xac(ac);<br><br>if i want to add other binary variable on the set C, then i would do
<br> MP_binary_variable Yc(C);<br>or i would do<br> MP_subset<1> cc(C);<br> forall(ac(a,c), cc.insert(c));<br> MP_binary_variable Yc(cc);<br><br>my question is because i want to declare after         the objective function that minimize the variable binary "Yc", ie i will think to do
<br> <br> minimize( sum( cc(xc), Yc(xc)) ); is this correct? <br><br>and, if i want to add the constraint P ("MP_constraint P(A)"), such that<br> P(a) = sum( C(c), Xac(ac(a,c)) ) == 1;<br>or i would do <br> MP_subset<1> cc(C);
<br> forall(ac(a,c), cc.insert(c));<br> forall(ac(a,c), aa.insert(a));<br> MP_constraint P(aa);<br> P(aa(a)) = sum( cc(c), Xac(ac(a,c)) ) == 1;<br><br>I am a bit confused when working with subsets. Thanks<br>