Hi,
you could use a tuple set in order to deal with half the matrix.
And then if you need an index with 2 dimensions, you may use a dexpr. (y in my tiny example)
int Size=4;
tuple t
{
int i;
int j;
}
{t} index={<i,j> | ordered i,j in 1..Size};
dvar int x[index] in 0..1;
dexpr int y[i in 1..Size,j in 1..Size]=(i==j)?0:((i<j)?x[<i,j>]:x[<j,i>]);
subject to
{
x[<1,2>]==1;
y[3][2]==1;
}
regards
PS: Many how to with OPL at https://www.linkedin.com/pulse/how-opl-alex-fleischer/
#DecisionOptimization#OPLusingCPLEXOptimizer