Ok, you are lucky since one of the variables in question is a boolean variable. The constraint to linearize is
forall (i in v)
constraint3:
u[i] <= sum(k in t) s[i][k]*p[i][k];The problematic thing in this constraint is the term
s[i][k][ * p[i][k]. Given that
p is a boolean variable, this term is either equal to 0 or equal to
s[i][k]. So you can use the implication operator
=> and define a new helper variable
dvar int+ sp[w][tt]; // s[i][k] * p[i][k]to add these constraints
forall (i in v, k in t) { (p[i][k] == 0) => (sp[i][k] == 0); (p[i][k] == 1) => (sp[i][k] == s[i][k]);}Then you can write constraint3 as
forall (i in V) constraint3: u[i] <= sum (k in t) sp[i][k];This is now a linear constraint that CPLEX can handle.
------------------------------
Daniel Junglas
------------------------------
Original Message:
Sent: Thu September 03, 2020 10:21 AM
From: Cindy Alves
Subject: IBM ILOG CPLEX: CPLEX Error 5002
Hi Daniel,
Thank you for your answer.
No, I didn't post the full model. Yes, variables u, s and p appear in other constraints. So, I must keep the constraints.
Please find below some of the Decision Variables:
/******Decision variables*******/
dvar int+ s[w][tl];
dvar int+ u[v];
dvar boolean x[vl][vll][t];
dvar boolean p[v][t];
dvar boolean bv[v][tl][t];
/*****Other constraints*******/forall (i in v)
constraint4:
sum(k in t) p[i][k] == 1;
forall (i in vl, j in vll: i!=j, k in t)
constraint5:
s[j][k] >= s[i][k]+sti[i]+tij[i][j]-M*(1-x[i][j][k]);
forall (i in v, k in t)
contstraint6:
u[i] >= s[i][k];
In that case you can probably linearize the constraint easily
How can I do that? Can you give me some appointments please?
Thank you in advance.
------------------------------
Cindy Alves
------------------------------
Original Message:
Sent: Thu September 03, 2020 07:02 AM
From: Daniel Junglas
Subject: IBM ILOG CPLEX: CPLEX Error 5002
No. This is a non-convex quadratic constraint and CPLEX cannot handle this.
However, did you post your full model? It seems that the variables u, s, p do not appear anywhere else? So you could set them all to 0 and remove the constraint.
If this is not the full model and you have to keep the constraint, what are the types of u, v, and p? Does any of s or p happen to be a boolean decision variable? In that case you can probably linearize the constraint easily.
------------------------------
Daniel Junglas