What are the advantages of using the generic callback compared to the old user/lazy callbacks within a branch-and-cut framework?

IBM states on its website that the major benefit of the new generic callback is that it allows for dynamic search strategies. However, most researchers still solve their MIPs with a branch-and-cut framework and then this dynamic search is not possible anyway (correct me if I am wrong). On top of that, the new callback provides a lower degree of control on the branch-and-bound/branch-and-cut process. IBM rightly states that this low-level control is often not required, however for academic purposes, it is good to have some control, for instance to more fairly test the effectiveness of new valid inequalities or branching rules.

This lets me wonder whether the generic callback brings other considerable advantages besides the dynamic search strategy. And are those new features worth the effort to re-implement already working algorithms?


2 Answers 2


Edit: one advantage of generic callbacks is that they can be run without turning off dynamic search, while legacy callbacks (such as the old user/lazy callbacks) cannot be run with dynamic search, and therefore generic callbacks can sometimes (but not always) be faster.

However, as you point out, there are two disadvantages to using generic callbacks:

  • Reduced low-level control.
  • Generic callbacks need to be thread-safe, which can be challenging to implement.

Sometimes the benefits of multi-threading are worthwhile and sometimes they aren't; it depends on the problem.

For more reading on generic vs legacy callbacks, see here: https://orinanobworld.blogspot.com/2017/11/cplex-128-generic-callbacks.html

  • 2
    $\begingroup$ It is not true that the legacy callbacks can only be run on a single thread. If you set the threads parameter to a positive value, then the callbacks can be run concurrently. See the link provided for full detail. $\endgroup$
    – rkersh
    Commented Jun 3, 2019 at 21:13
  • $\begingroup$ I wasn't aware of this, is this new in version 12.9? In any case, edited accordingly. $\endgroup$ Commented Jun 3, 2019 at 21:38
  • $\begingroup$ It has been that way for several years (since 12.5 and perhaps earlier). $\endgroup$
    – rkersh
    Commented Jun 3, 2019 at 21:56
  • 2
    $\begingroup$ Btw, the reason not to accept this answer is that it does not give any benefit besides the dynamic search strategy (which is not possible within in a branch-and-cut as mentioned in the title), which is specifically asked for in the question. You have my upvote though :) $\endgroup$ Commented Jun 4, 2019 at 0:20

If it is worth or not to re-implement existing algorithms is heavily dependent on what kind of algorithms and what bottlenecks the current code is facing.

As a practitioner I would always try to make a "business case" with pro's and con's. Some very generally remarks (I haven't tried the new dynamic search myself)

Some pro's for re-writing:

  • Faster code (by multi-threading if I understand it correctly)
  • Get experience using the new feature on known code (makes it easier to judge the impact the new feature has)

Some con's:

  • Harder to debug (I think)
  • Time consuming with unknown benefit
  • Reduced low-level control (as mentioned by Ryan Cory-Wright)
  • Needs to be thread-safe

Ask yourself if this is the best possible way to improve your code. Maybe you have other parts of the code with some low hanging fruits. There is probably not one answer to your stated question.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.