pythonlinear-programminginteger-programmingbranch-and-bound

Is there a good option for creation of custom branching rules in branch-and-bound for MILPs in Python?


Basically, I want to recreate the conceptual results from the paper "Learning to Branch in Mixed Integer Programming" by Khalil, et al, at the same time avoiding, if possible:

1)The necessity of obtaining an academic license for CPLEX (which was used in the paper) or similar serious commercial solver

2)The necessity of using C based API. This is not a strict requirement, but Python has the benefit of having good and very accessible ML libraries, which seems like a great advantage for this specific goal

I am aware, that there is a great number of open source Python based MILP solvers, but a lot of them focus on the end-to-end solution of relatively simple problems in their presentation and, if we also consider, that a lot of them (if not all) hook up to other C based solvers, it is highly non-obvious to judge, which ones actually have needed customization potential.

So, if anyone has more in-depth experience with trying to customize Python solvers for their highly specific needs, I would appreciate the advice.


Solution

  • I'm afraid you will hit a roadblock at some point there. It's really hard to do that without doing C/C++ work (imho).

    Python-way

    I only know three projects with some low-level functionality (and it's still hard to say if those fit your needs).

    Alternative: C++

    If trying to get full-control; which might be needed, with minimal need for understanding the underlying solver in all it's details, you probably want to use C/C++ within Coin OSI. Sadly the Cbc part is unmaintained, but depending on your exact task, you might only need Clp for example.

    Alternative: Julia

    I did not follow the recent developments there, but the language did have a strong early focus on Mathematical Optimization (driven by a big group of people) surpassing python even in it's early days (imho!).

    But i'm not sure if MathOptInterface is fine-grained enough for your task.