The Python-MIP package
Python-MIP is a collection of Python tools for the modeling and solution of Mixed-Integer Linear
programs (MIPs). Its syntax was inspired by Pulp, but our package also provides access to advanced
solver features like cut generation, lazy constraints,
MIP starts and solution pools.
Porting Pulp and Gurobi models should be quite easy.
Main features
It is Fast!
Python-MIP calls directly the native dynamic loadable library of the installed solver using cffi. Models are efficiently stored and optimized by the solver and all communication with your Python code is handled transparently.
Full featured
Python-MIP supports cut generators, lazy constraints, solution pool, MIP start, and additional features. By using a simple callback system, the user can exchange information with solvers in a transparent manner.
Multi-solver
Currently integrated with the C libraries of COIN-OR CBC solver and the commercial solver Gurobi. Other solvers will be supported soon.
Comes with CBC binaries
The Python-MIP package comes pre-installed with CBC binaries for most used operational systems (Windows, MacOS and Linux). Super easy to run!
High-level
Write your Mixed Integer Programming models in python as easily as in high level languages such as MathProg. Several examples are included.
Compatible with PyPy
Creation of large MIPs is up to 25 times faster than the official Gurobi python interface (which only runs on CPython).
We make Python-MIP with passion and three goals in mind
Ease of use
Python-MIP is an intuitive high level modeling tool. Operator overloading makes it straightforward to write linear expressions.
Read the documentationHigh performance
Yes, high performance with Python! Integration with C code and compatibility with PyPy compiler results in very fast model generation.
Read the documentationExtensibility
Extensibility and configurability are priorities. Support to additional solvers and non-standard configurations can be easily included.
Read the documentationTestimonials
Richard Western
Australian Red Cross Lifeblood
Thanks for building such a great package – we’re using it to optimise how we collect 1.5M annual blood donations across Australia. Your toolkit is helping save lives on the other side of the planet!
Serdar Kadioglu
Brown University
I was recently involved in a project, with researchers from different backgrounds, and Python-MIP was amazing to use as a common medium; simple install, friendly API, integrates immediately into python machine learning/data science pipelines —great experience, kudos to the team!
Contact our Team
Python-MIP is a project developed and maintained mainly by two Brazilian professors working at the Department of Computing of the Federal University of Ouro Preto (UFOP). In 2019 the project became part of COIN-OR.
Public discussion forum: Python-MIP google group