Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Getting bounds from LazyConstraint callback with heuristic solutions

    Posted Thu May 27, 2021 04:04 PM
    Hi all..  I'm coding a LazycutCallback using DOcplex.MP v2.11 from CPLEX Studio v12.10.

    For the callback, I need the current lower/upper bound at the node for the integer variables, to construct a local cut (using 
    get_lower_bounds() and get_upper_bounds() functions.  However, I'm getting some inconsistent results for these bounds. I just noticed that these inconsistencies occur only when the current solution comes from CPLEX internal heuristic solution (get_solution_source() == heuristic_solution ). 

    My question: Is this a expected result?  Can you get the node upper/lower bounds when the current solution is an heuristic solution? Or these bounds are only valid for node_solution solutions?


    ------------------------------
    Eduardo Moreno
    ------------------------------

    #DecisionOptimization


  • 2.  RE: Getting bounds from LazyConstraint callback with heuristic solutions

    Posted Thu May 27, 2021 05:25 PM
    Quoting the documentation for the Java API getLBs() method:



    ------------------------------
    Paul Rubin
    Professor Emeritus
    Michigan State University
    ------------------------------



  • 3.  RE: Getting bounds from LazyConstraint callback with heuristic solutions

    Posted Thu May 27, 2021 08:08 PM
    Very interesting. Thanks! That explains my problem...

    I assume that this applies only to LazyCutCallbacks, not UserCutCallbacks (since in this case, no new solution has been found).

    Best!

    ------------------------------
    Eduardo Moreno
    ------------------------------



  • 4.  RE: Getting bounds from LazyConstraint callback with heuristic solutions

    Posted Thu May 27, 2021 11:24 PM
    I'm not sure about that last part. When the user cut callback is invoked, you are not guaranteed that a new solution has been found, but it could have been. For instance, if the node LP has an integral solution, I think that will be detected before the user cut callback is called.

    ------------------------------
    Paul Rubin
    Professor Emeritus
    Michigan State University
    ------------------------------



  • 5.  RE: Getting bounds from LazyConstraint callback with heuristic solutions

    Posted Mon May 31, 2021 09:18 AM
    Wait, this is not good.   Because UserCutCallback doesn't have the option to get the origin from the current solution (function get_solution_source(self) from LazyConstraintCallback, at least in the Python framework).  

    Can anyone confirm a "safe" way to get the current LB/UB of the current node?


    ------------------------------
    Eduardo Moreno
    ------------------------------