intlinprog: integer linear program solver
See original GitHub issueIs your feature request related to a problem? Please describe.
intlinprog
: a branch and bound mixed integer linear program solver built on top of scipy.optimize.linprog
.
@mdhaber has proposed possible integer constraints in #9269. ILPs/MIPs are an entire class of problems that are very related to LPs, but which have an ecosystem of their own, suggesting that scipy might benefit from having a separate solver for ILPs/MIPs. MATLAB and Octave also contain dedicated MIP solvers.
Describe the solution you’d like
A simple solver that can handle smaller to medium size problems. Doesn’t need to be CPLEX, Gurobi quality, something that will “just work” out of the box for reasonable problems and which has a scipy-consistent interface, i.e. works approximately like linprog.
Describe alternatives you’ve considered
A lot of existing solutions use the optimization idioms of commercial solvers, i.e. create classes for Variables and Models, etc. Other packages provide a wrapper on top of other solvers, no simple “out-of-the-box” experience.
Additional context (e.g. screenshots)
I have created a fork and added some code I was using for a personal project. I’ve started to modify it to conform to the existing norms of the optimize
module, but it still needs additional documentation and potentially a few upgrades as noted below:
- uses branch and bound
- does not branch and cut, might perform better with a few cutting plane algorithms (e.g. Gomory cut)
- uses
linprog
'revised simplex'
to solve relaxed linear program subproblems'interior-point'
leads to failure in some instances due to inherent approximations of the interior-point algorithm
- Implements several branching rules, easy to add new ones
- does not implement a pseudo-cost branching rule currently
- Tries to implement a function signature similar to
linprog
- Works very well for small problems, medium problems (~8 variables) can be slow and depend a lot on search strategy used, i.e. depth-first, breadth-first, or best-first
The original work was done here: https://github.com/mckib2/bnb/blob/intprog/bnb/intlinprog.py
Scipy fork including intlinprog
prototype: https://github.com/mckib2/scipy/blob/master/scipy/optimize/intlinprog.py
Goal of this issue
Get feedback and help on possible integration into scipy.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:78 (45 by maintainers)
@rgommers Cython wrapper already functional here (might not be right now because I am doing some rearranging). CMake is not used (I do scrape some info from the CMakeLists.txt to inject into build). Everything is built from setup.py.
Closing as HiGHS MIP solver has been released