hello everyone,

I have the following lines in my model:

set

i/1*400/;

alias(i,j);

binary variable x(i,j,k);

con(i,k)..sum((j)$(ord(j) ne ord(i)),x(i,j,k))=E= sum((j)$(ord(j) ne ord(i)),x(j,i,k)) ;

as you can see, I reversed the order of (i)&(j) in the variable x(i,j,k) to become x(j,i,k). for this constraint, I need to place (i) once in the first index for the first summation and in the second index for the second summation.

my question: is this syntax acceptable? in if not, what should I do to tackle this problem?

Thank you,

## swapping indices in a variable

### Re: swapping indices in a variable

Hi,

Not sure what you find "acceptable" but at least this is correct GAMS syntax (which you could easily figure out by the fact that there is no compilation error).

Best,

Fred

Not sure what you find "acceptable" but at least this is correct GAMS syntax (which you could easily figure out by the fact that there is no compilation error).

Best,

Fred