-1

I want to achieve the BAB tree structure like,

Branch and Bound Tree Example

I am trying to use R, matlab and CPLEX, but cannot figure it out.

jyfeather
  • 54
  • 6
  • 1
    What do you mean "achieve"? Are you just trying to draw this plot? What's your input data? – MrFlick Apr 21 '15 at 18:44
  • Input is a mixed integer linear programming problem. I want to get the structure of the BAB tree, which means the nodes and branches. It is better to get the plot. Am I clear? – jyfeather Apr 21 '15 at 19:54
  • No. That's still not clear. Try creating a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) that shows what types of objects you are working with in R. – MrFlick Apr 21 '15 at 19:58
  • https://gist.github.com/jyfeather/6450c7f0cad4bb16d796 I hope this snippet could help you understand my problem. – jyfeather Apr 21 '15 at 22:02

1 Answers1

1

In C++ you could retrieve the Branch-and-Bound (B&B) information via a Callback. In simple terms, a callback is an instruction that is declared before optimisation to CPLEX and whenever the condition is met during the B&B, CPLEX will stop and enter the callback to execute your code.

As you can see this is exactly what you need, although most people use them to impose cuts or valid inequalities as a walkaround to avoid setting a priori an exponential number of constraints, and only add them on-the-go. Nothing stops you from declaring a very general condition that will be satisfied at every node of the tree, and then extract all the information you might need and construct the tree based on that info. You only have to go read CPLEX documentation to determine which is the more suitable callback depending on your problem and need.

One is glad to be of service

Jacko
  • 88
  • 12