Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Terminate Optimization from Callback

    Posted 08/29/16 01:22 PM

    Originally posted by: Kyle_Coventry


    Hi there,

    A fairly specific request here. I am currently using lazy callbacks to assess incumbent solutions and add constraints to the model as necessary. In some cases, when I have finished assessing a particular integer incumbent, I need to terminate the optimization as there is a certain characteristic to this solution that lets me know it is sufficient for my needs. How can I terminate the optimization once this solution is found? I can't terminate by adding a constraint (e.g. objective <= incumbentObjective for maximization) as it would appear the addition of this constraint throws away the incumbent solution even though it satisfies the constraint I add to the model.

    Please let me know if there is anything that can be done here, thank you!

    Kyle


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Terminate Optimization from Callback

    Posted 08/30/16 02:37 AM

    You can terminate a solve from a callback by returning a non-zero status from the callback or setting the useraction_p argument to CPX_CALLBACK_FAIL in case you are using the callable library. For the object oriented APIs just invoke the callback's abort() method. The drawback of this is that optimization stops immediately, hence the incumbent will be discarded. You can work around this by storing away the incumbent yourself in the callback.

    Another option would be to add another callback, for example a branch callback. In the lazy constraint callback, when you recognize that you can stop optimization just set a (global) flag. In the branch callback test this global flag and if it is set abort optimization as described above.

    The reason why adding "objective <= incumbentObjective" does not work is this: as soon as you add a constraint from the callback CPLEX assumes the current solution is infeasible and discards it. CPLEX does not check whether the constraint is redundant and does not actually cut off the solution (that is your job :-) )


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Terminate Optimization from Callback

    Posted 08/30/16 02:48 AM

    Originally posted by: Kyle_Coventry


    Thanks for the response - appreciate it. I ended up going with the abort() option within the callback and storing the incumbent information myself... It would be a nice design option if there was an abort() option that did not discard the incumbent as the current method is a bit of a pain. Thanks again!


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Terminate Optimization from Callback

    Posted 09/04/16 04:10 AM

    You may want to file a request for enhancement for this at http://www.ibm.com/developerworks/rfe.


    #CPLEXOptimizers
    #DecisionOptimization