Originally posted by: SystemAdmin
[Strider said:]
Hello,
I have a MIP model (no-wait job shop problem) for which I can infer new constraints that must be valid if certain other constraints in my model are satisfied. They do not change the final solution of the model at all. (i.e. constraint propagation).
I can model these conditional constraints using IloCplex.or, and then add them to the model in front using IloCplex.ifThen. The idea is to try to use these extra constraints to speed up cplex's solution time; but until now without any luck; I think this is mainly because the constraints introduce new boolean variables....
I can also make these constraints in my own way with boolean variables, but this too slows down solution time, even if I only add them inside a BranchCallBack when I am certain that they are applicable in all subnodes, there is no speed increase. (I have added the extra boolean variables for the extra constraints up front; but without adding the constraints yet). Adding the constraints as cuts doesn't seem to speed the time up either.
So now I was trying to add the constraints as cuts (either with addCut or addUserCut), but by using cplex's ifThen and or. I also tried it again inside a BranchCallBack where I only needed IloCplex.Or. In both cases (in Java) I get a runtime Exception like this:
java.lang.ClassCastException: ilog.cplex.CpxIfThen cannot be cast to ilog.cplex.CpxRange
(with CpxOr if I try an or constraint).
So I have 2 questions:
1. Is this error because you cannot add cuts from constraints that implicitly add extra variables? How come the API does not explicitly forbid this; and doesn't pick it up at compile time?
2. Should I give up on improving solution time when the inferred constraints need extra binary variables? Or is there a way?
#CPLEXOptimizers#DecisionOptimization