0
votes

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?

1

1 Answers

0
votes

Ok, the problem was that I forgot the neutralizing "1" in the first term of the inequation. Hence it should be:

-2000(1-w[i][j][q][k]) +t[i][j]+s[i]+d[i][j]-t[i][k] <= 0

As that "1" was missing in the first term, the left part of the inequation was not neutralized for the case w[i][j][q][k] == 1.