Originally posted by: taito
Hello. I am Japanese, so I am sorry not to write statement by English well.
And, I am beginner.
I want to add some constraints during optimization of a MIP dynamically.
The one of the constraints I want to add is as follows.
IloNum M = 1000.0;
IloNum N = 2.0;
IloNumVar p( env, 0, +IloInfinity, ILOFLOAT );
IloNumVar q( env, 0, +IloInfinity, ILOFLOAT );
IloNumVar a( env, 0, 1, ILOINT );
IloConstraint c( env, -M <= q - p <= M * ( 1 - a ) ) - N; // <--- this
I am implementing my application using C++.
Because these constraints are unlikely violated, I tried to use lazy constraint.
But, program throws exception at cplex.addLazyConstraint function.
This exception is "InvalidCutException: invalid cut".
Why?
Is the constraint not a linear?
Is using addLazyConstraint not correct?
How to implement adding constraint during optimization of a MIP?
#CPLEXOptimizers#DecisionOptimization