3 summations in 1 constraints on CPLEX

113 views Asked by At

how to model something like forall the sum of (x) sum of (y) sum of (z) dvar(x;y;z)==1

I made this but it doesn't work:

forall (t in T) sum(o in O) sum(w in W) sum(h in H) x[t,o,w,h]==1;

Cplex said: unexpected forall ?

thank you

1

There are 1 answers

0
Asmaa Sabiri On

I guess it's a constraint. It should be something like this : subject to : { forall (t in T) Constraint_Name: sum (o in O, w in W, h in H) X[t][o][w][h] == 1; } look for "cplex tutorial" on google there are also tutorials on IBM website.