3

I want to implement a custom variable selection heuristic for solving an MLP using the CPLEX Python API.

Unfortunately, I cannot find any examples or documentation for this.

Ist this actually possible using the CPLEX Python API, or do I need to use C++?

Can I achieve this using the BranchCallback [1]?

[1] https://www.ibm.com/support/knowledgecenter/SSSA5P_12.5.0/ilog.odms.cplex.help/refpythoncplex/html/cplex.callbacks.BranchCallback-class.html

Christopher
  • 277
  • 2
  • 11

1 Answers1

1

The functionality of the BranchCallback in the CPLEX Python API should be nearly identical to that of BranchCallbackI provided in the C++ API. Parallel callbacks are hindered by the global interpreter lock (aka, the GIL) in Python, however.

The admipex1.py, and admipex3.py Python examples demonstrate how to use the BranchCallback class and are included with CPLEX. For the corresponding C++ examples, see iloadmipex1.cpp and iloadmipex3.cpp.

rkersh
  • 4,447
  • 2
  • 22
  • 31