Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

Generic Callback: using candidate context without turning off dual reductions

  • 1.  Generic Callback: using candidate context without turning off dual reductions

    Posted 05/06/19 10:05 AM

    Originally posted by: Gert-Jaap


    Dear Sir/Madam,

    I have been using CPLEX's (legacy) callbacks for a while and now I'm trying to switch to generic callbacks. However, there is one issue that I don't know how to solve.

    The thing is that I want to write my own CPLEX-log in a specific format in some text file. In order to determine if a new incumbent solution is found, I used to call the function hasIncumbent(), and check to objective value if indeed it was an improvement. My impression was that in the generic callback environment, I would just call the callback in the Candidate context and check if I'm indeed in the candidate context to replace the hasIncumbent(). However, using a callback in the candidate environment forces the dual reductions etc to be switched off by default. Overriding this seems not to have any effect. This drastically increases solving time. I only use the candidate context for logging, and not for adding lazy constraints for example, in which case turning the dual reductions is a logical thing to do. Is there some way to check from another context (relaxation/global progress) if the current solution is an incumbent candidate?

    Best,

    Gert-Jaap

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Generic Callback: using candidate context without turning off dual reductions

    Posted 05/07/19 07:56 AM

    In your situation, it is better to use the local and global progress contexts (I would go for the global progress since that means you don't have to do locking etc.).

    The candidate context is designed for cases in which you may want to reject a candidate eventually. Also note this sentence from the documentation:

    If the callback is invoked for a feasible point and does not reject the candidate, this is no guarantee that the candidate will become the new incumbent. The callback is only one of many feasibility tests that are performed on a candidate solution.

    A solution that passes the candidate context may still get rejected in very specific corner cases. However, whatever shows up in the global progress context is real.


    #CPLEXOptimizers
    #DecisionOptimization