I have a few collection ,and the intersection of these collections gives me a few new collection.
I want to have summation under these intersections , but some of these are null. And I get an error for my summation, for example
Set I/1*3/;
Set j/1*3/;
Set s(I,j)
1.(2,3)
2.(1,3)
3.(2);
Alias (I,i1,j);
Set intersection (I,i1,j);
Intersection (I,i1,j)= s(I,j)*s(i1,j);
Variable x(j) ,z;
Binary variable x;
Equation c1,c2;
C1(I)..sum(j$s(I,j),x(j))=e=z;
C2(I,i1)..sum(j$ intesection(i,I1,j),x(j))=g=1;
Model test /all/;
Solve test using lp minimizing z;
I have error for constraint 2 because intersection(2,3) is null ,and I have 0> 1
How can I write this summation?