Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Node callbacks

    Posted 05/16/16 05:56 AM

    Originally posted by: Oskar Wigstrom


    Hello,

     

    I have two questions conserning callbacks and would really appreciate some help.

     

    1. I'm solving a mixed integer problem and have a heuristic available which can determine whether or not a node is feasible (based on the current full/partial integer assignment).

    Is it possible to add a callback at each node, which is called before anything else, and which may: "Flag a node as infeasible and have the current branch cut", "Change the bound on variables, i.e. fixing integer variables (only for that specific branch though!)"

     

    2. Some of the constraints in my problem are non-linear and are thus not explicitly included in the CPLEX model. I'd like to extend the functionality of CPLEX to handle these non-linearities. Is there any callback which is executed after CPLEX is done with the current node which would allow me to: "Flag the node as infeasible and have the current branch cut", "Tighten the local solutin found by Cplex at the current node", "Add cuts that contribute to the model formulation (linearizations), which may also be removed".

     

    I am aware of the existance of MINLP solvers but I'm curious about the capabilities of CPLEX.

     

    Best regards,
    Oskar Wigström

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Node callbacks

    Posted 05/21/16 04:13 PM

    The second part is moderately straightforward. Add a branch callback. In it, call the prune() method if you want to kill the node. Otherwise, you can use the getBranchType() and getBranches() methods to find out how CPLEX was planning to branch, add any additional constraints you came up with, and create those child nodes. (I'm using the Java API method names, but the methods exist in most if not all programming APIs).

    For the first part, the only callback I can think of that would be invoked before any processing at a node would be a solve callback (I think). I'm not sure it's possible to do what you want in a solve callback. You could attach a user cut callback, which is invoked after the node is LP solved (and any cuts generated by CPLEX are added). The user cut callback has an addLocal() method that could be used to add variable fixings, but I don't recommend it -- it violates an implicit contract that says that only lazy constraint callbacks will add cuts that cut off integer feasible solutions. (The lazy constraint callback won't do what you want -- it's only invoked when an integer feasible solution is found.) The user cut callback has no prune method, although hypothetically you could add a constraint guaranteed to make the node infeasible.

    My suggestion would be to use just a branch callback and not worry too much about processing done at the node before the branch callback is invoked. (It's more or less the last step at the node.)


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Node callbacks

    Posted 05/23/16 03:22 AM

    Originally posted by: Oskar Wigstrom


    Thank you for your help Paul!


    #CPLEXOptimizers
    #DecisionOptimization