Hi, How to express something like the following in OPL:
forall( i in 1..n)
sum(j in M[i]) x[j] >=1;
Where M[i] is a set dependent on i.
Thanks in advance.
Hi, How to express something like the following in OPL:
forall( i in 1..n)
sum(j in M[i]) x[j] >=1;
Where M[i] is a set dependent on i.
Thanks in advance.
Hi,
what you wrote is correct and let me give you a full example that works fine:
int n=10;
{int} M[i in 1..n]={1,i};
dvar int x[1..10] in 1..10;
subject to
{
forall( i in 1..n)
sum(j in M[i]) x[j] >=1;
}
regards