I have a constraint that i need to incorporate in my java/cplex program. the constraint is:
(forall q: x[i][j][q][k])(t[i][k]+s[i]+distance[i][j]-t[j][k]) <= 0 forall k, i, j
if I put it in just like that, I get the cplex 5002 (is not positive semi-definite) error because the formulation is not linear. I did the following to linearize the constraint and avoid the problem:
for(int k=0; k<Ausführung.k; k++){
for(int i=1; i<grossI.length; i++){
for(int j=1; j<grossJ.length; j++){
//for(int q=1; q<grossQ.length; q++){
IloLinearNumExpr sumLastTerm = model.linearNumExpr();
for(int q=1; q<grossQ.length; q++){
sumLastTerm.addTerm(-1.0, w[i][j][q][k]);
}
IloConstraint con = model.addLe(model.sum(model.prod(-2000, sumLastTerm), model.sum(t[i][k], model.sum(Data.service[i], model.sum(distance[i][j], model.prod(-1.0, t[j][k]))))), 0);
con.setName("NB (9.7)."+k + i);
}
}
}
Now, I get a "Row 'NB (9.7).01' infeasible, all entries at implied bounds." error message. I tells me that the error lies in this constraint, just when starting to iterate through it. Can anybody tell me where my mistake is or otherwise verify that it must lie somewhere else?