0
votes

I am working on a model which is MIP. The model solves very quickly generally, but if I am trying to add IF- THEN constraint to the model the solve time exponentially increases to a point where its not able to get a feasible solution within 2000s. I have also tried indicator constraints but without any luck. Is there alternative to IF- THEN constraint which solves faster? or should I reduce the horizon of my problem to get a solve? or are there any CPLEX parameters which performs better with IF- THEN constraints? Any ideas are welcomed

3

3 Answers

0
votes

you could have a look at the technote

Difference between using indicator constraints and a big-M formulation

https://www.ibm.com/support/pages/node/397209

And if your model is about scheduling you could have a look at

https://www.slideshare.net/PhilippeLaborie/planningscheduling-with-cp-optimizer

0
votes

Are you using Cplex through DOcplex or OPL? Are you experiencing slow performance in model building or in model solve?

To investigate slow performance in solve, could you try reduce the problem as much as possible and generate a LP or SAV file? Thanks.

0
votes

DOcplex's if-then construct allocates two internal constraints: one equivalence constraint to define the if_ct status variable, and one indicator constraint to link this status variable to the then_ct. At the end of the day, two indicator constraints are generated.

If the condition consists in one boolean variable tested against 0 or 1, this might be simplified to one indicator constraint (actually, this simplification will be done in Docplex's next version). For example, this code allocates one indicator constraint

 m.add_indicator_constraint(b, y>=3)

but this one allocates two:

m.if_then(b==1, y>=3)

which is not really necessary. However, if the condition constraint is not a simple binary variable test, the if-then construct is the way to go.

If a large number of if-then constructs are used, this might explain the solve performance issue? It would help to have the numbers as printed by Model.print_information to see how large your model really is.