question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

intlinprog: integer linear program solver

See original GitHub issue

Is 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:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:78 (45 by maintainers)

github_iconTop GitHub Comments

1reaction
mckib2commented, Mar 29, 2020

@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.

0reactions
mckib2commented, Dec 28, 2020

Closing as HiGHS MIP solver has been released

Read more comments on GitHub >

github_iconTop Results From Across the Web

intlinprog - Mixed-integer linear programming (MILP)
Mixed-integer linear programming solver. Finds the minimum of a problem specified by. min x f T x subject to { x ( intcon...
Read more >
INTLINPROG - YALMIP
INTLINPROG. Mixed-integer linear programming solver ... INTLINPROG is invoked by using 'intlinprog' as solver flag in sdpsettings.
Read more >
Solving Mixed-Integer Linear Programs with MATLAB
We use the built-in mixed-integer linear program solve of MATLAB, intlinprog. • To see the optimal objective function value, we can use: •...
Read more >
How to use MATLAB to solve integer linear programming ...
MATLAB has a built in integer linear programming solver called intlinprog. If you type intlinprog( only opening bracket( after intlinprog at the command ......
Read more >
intlinprog | Scilab.in
Search the minimum or maximum of a constrained mixed integer linear programming optimization problem specified by : CBC, an optimization library written in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found