Originally posted by: PhilDac
Hello all,
i created a powerset by using information from this forum :
{int} I = {0,1,2,3,4,5,6,7};
range r=1.. ftoi(pow(2,card(I)));
{int} s2 [k in r] = {i | i in I: ((k div (ftoi(pow(2,(ord(I,i))))) mod 2) == 1)};
Now I am trying to formulate a constraint:
forall(S in s2: card(S) > 1 && card(S) < (card(I)-1))
sum(i in S, j in S) x[i][j] <= (card(S)-1) ;
It doesnt work right now. Can anyone help me with this problem?
What I am trying to do is take all the subsets S of the powerset s2 which are bigger than 2 and smaller than the cardinality of I -1 and then compare the sum of a variable x(i,j) where i and j should be each of the numbers in subsets s to the cardinality of S -1
#DecisionOptimization#OPLusingCPLEXOptimizer