I need to fill the 6*6 matrix as shown in the above.
Here (i,j) is from 0 to 6
So I used below code to achieve the matrix as shown above
Here my question is I am trying to achieve this constraint x(i,j)=1 if either i or j =0 or 6
Is there a better way to use Index domain to achieve that
Best answer by gdiepenView original
Forgot to mention, if you replace 7 with card(SetName) where SetName is the name of the set they belong to, you will make it right away generic for any input.
You are using everywhere a range check, while you can also do just a comparison, which makes it a bit less complex
So you can achieve the same with: