Originally posted by: scubla88
Hi,
I'm a new user of CPLEX. I'm trying to model the CARP (The Capacitated ARC Routing Problem).
I have a problem about a constraint. I want to do a sum of x[i][k][v] in a loop.
I'm using c++, and I wrote this code:
for(v=0;v<veicoli;v++){
for(i=0;i<vertici;i++){
IloExpr somma(env);
for(int k=0;k<vertici;k++){
somma+=x[i][k][v];
}
model.add(somma%2==0); // ???????
somma.end();
}
I want the sum is even, but I have not found the operator "modulo" on the IloExpr, but only on IloIntExprArg but i can not use it.
Can anyone help me???? Thank you very much!!!
#ConstraintProgramming-General#DecisionOptimization