Hi,
suppose you want all the subsets of the set s in the array of sets s2
{string} s={"A","B","C","D"};
{string} s2[i in 0..ftoi(pow(2,card(s)))-1]={};
int nb=ftoi(pow(2,card(s)));
execute
{
for(var i in s)
{
for(var j=0;j<=nb-1;j++)
{
if ((j >> Opl.ord(s,i)) % 2==1) s2[j].add(i);
}
}
writeln(s2);
}
and then you can iterate in a constraint with
forall(k in 0..ftoi(pow(2,card(s)))-1)
and then use s2[k]
regards
#DecisionOptimization#OPLusingCPLEXOptimizer