Originally posted by: Ibrahim_Capar
Hello all,
I am using lazy constraints to add complicating constraints to my problem. Before add a new constraint, I check whether the current solution is violating any lazy constraint. Let say that I have only one set of decision variable, "X", which is binary. I use:
getValues(XSol, X); to copy current solution (one dimensional array) . Naturally XSol might be epsilon away from 0 or 1, i.e. 0.00001 is 0 and 0.99999 is 1;. However I realized that XSol contains values such as:
0.2
0.333333
0.5
0.6
0.666667
0.8
From my experimentation, this occurs on CPLEX 12.6.2 (64 bit), and 12.6.3 (64 bit). When I run the same code with 12.5.1 (64 bit), everything works fine.
I am using C++ on Microsoft Visual Studio Professional 2012 Ver 11.0.6 Update 5 under Windows 7 64 bit. My code structure is:
ILOLAZYCONSTRAINTCALLBACK1(UserCutName, IloIntVarArray, X){
...
getValues(XSol, X);
...
}
int main(){
....
IloEnv env;
IloIntVarArray X(env);
for (int i=0; i<Node; i++)
X.add(IloIntVar(env,0,1));
.....
IloCplex cplex(env);
cplex.use(UserCutName(env, X));
.....
}
I appreciate it any help to fix this problem. Thank you in advance.
Ibrahim
#CPLEXOptimizers#DecisionOptimization