Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  C API: How could I prune a node from solvecallbackfunc?

    Posted 08/08/19 05:24 AM

    Originally posted by: wendelmelo


    Hi everybody

     

    I have a question: I am implementing a special B&B for integer programming under Cplex. In my B&B formulation, I can apply some heuristics, and so, based on results, discard a B&B node before its continuous relaxation be solved.

     

    I have set my own callback function by means of function CPXsetsolvecallbackfunc (C API). However, I could not find yet a way to enforce Cplex prune the current node in my callback function. Does someone know a manner to prune the current node from this callback function?

     

    Thanks in advanced

     

    Wendel Melo


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: C API: How could I prune a node from solvecallbackfunc?

    Posted 08/08/19 04:14 PM

    I don't know about the solve callback (although I suspect it cannot be done there), but one possibility would be to add a branch callback. In the branch callback, you can find out how CPLEX intends to branch at the current node. There are ways you can track the sequence of decisions that led to a node (one approach being to attach user data to each node). Assuming that the sequence of decisions already made plus the decision(s) leading to an intended child node provides enough information for your heuristic, you can apply it and then either make the child as CPLEX intended or not. So effectively you prune nodes by never creating them in the first place.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: C API: How could I prune a node from solvecallbackfunc?

    Posted 08/20/19 05:10 AM

    Just want to confirm that Paul is right: the solve callback does not offer a way to prune the current node.


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: C API: How could I prune a node from solvecallbackfunc?

    Posted 10/10/19 03:38 AM

    Originally posted by: wendelmelo


    Thank you for your answer! I really need a simple way to prune a B&B node just before the exploration, not in the branching. It would be fine if I could suggest that to cplex developers. I believe it would be simple to them to provide a function for that.

    Anyway, I worked around this problem getting the lp problem pointer using CPXgetcallbacknodelp and so changing some variable bounds to turn the current problem infeasible, but I think it's not ideal and maybe this action could generate some bug in some specific case. But I could not find another solution.

    Does someone know how I could make suggestions to cplex developers?

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: C API: How could I prune a node from solvecallbackfunc?

    Posted 10/10/19 06:03 AM

    Modifying the nodelp is not a good idea. It may indeed cause problems down the road.

    Instead I suggest you use a user cut callback and inject an infeasible local cut. That should have the same effect but is safe.

    You can reach CPLEX developers (like me) through this forum. Can you please elaborate on why you need to make this decision before solveing the nodelp? How do you figure out that the node can be cut off?


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: C API: How could I prune a node from solvecallbackfunc?

    Posted 10/10/19 02:19 PM

    Originally posted by: wendelmelo


    Thank you, Daniel Junglas.

    I cannot provide many details for now, but we are working on a specific application having a high level of symmetry. We are implementing a hard procedure to detect symmetry in some B&B partitions. We compare some random partitions with other already explored partitions. If we detect symmetry, we should prune the current node. The procedure is only applied in some partitions, and, for us, the best strategy is to prune the node is before solving the respective continuous relaxation, since we compare the B&B partition with others already explored, and we make use of data from that explored partitions. If we try to perform this prune in the branching time, it could even work in some cases, but we could be not able to get the same number of prunes.

    Anyway, I will study about set a local cut as you have suggested to see if it works in our case. But, I still believe, a simple cplex function to prune the current node would be the most elegant way.


    #CPLEXOptimizers
    #DecisionOptimization