Skip to main content

Python tools for Modeling and Solving Mixed-Integer Linear Programs (MIPs)

Project description


Fork Notice - Circuit Mind Interview

This repository is a fork of the original coin-or/python-mip library, created as part of an interview with Circuit Mind.


Python MIP (Mixed-Integer Linear Programming) Tools

Package website: http://python-mip.com

Python MIP is a collection of Python tools for the modeling and solution of Mixed-Integer Linear programs (MIPs). MIP syntax was inspired by Pulp. Just like CyLP it also provides access to advanced solver features like cut generation, lazy constraints, MIPstarts and solution Pools. Porting Pulp and Gurobi models should be quite easy.

Some of the main features of MIP are:

  • high level modeling: write your MIP models in Python as easily as in high level languages such as MathProg: operator overloading makes it easy to write linear expressions in Python;

  • full featured:

    • cut generators and lazy constraints: work with strong formulations with a large number of constraints by generating only the required inequalities during the branch and cut search;
    • solution pool: query the elite set of solutions found during the search;
    • MIPStart: use a problem dependent heuristic to generate initial feasible solutions for the MIP search.
  • fast: the Python MIP package calls directly the native dynamic loadable library of the installed solver using the modern python CFFI module; models are efficiently stored and optimized by the solver and MIP transparently handles all communication with your Python code; it is also compatible with the Pypy just in time compiler, meaning that you can have a much better performance, up to 25 times faster for the creation of large MIPs, than the official Gurobi python interface which only runs on CPython;

  • multi solver: Python MIP was written to be deeply integrated with the C libraries of the open-source COIN-OR Branch-&-Cut CBC solver and the commercial solver Gurobi; all details of communicating with different solvers are handled by Python-MIP and you write only one solver independent code;

  • written in modern typed Python 3 (requires Python 3.12 or newer).

Examples

Many Python-MIP examples are documented at https://docs.python-mip.com/en/latest/examples.html

The code of these examples and additional ones (published in tutorials) can be downloaded at https://github.com/coin-or/python-mip/tree/master/examples

Documentation

The full Python-MIP documentation is available at https://docs.python-mip.com/en/latest/

A PDF version is also available: https://python-mip.readthedocs.io/_/downloads/en/latest/pdf/

Mailing list

Questions, suggestions and feature request can be posted at Discussions.

Build status

CI Current version Current total of lines License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_mip26-2.2.0.tar.gz (11.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_mip26-2.2.0-py3-none-any.whl (11.5 MB view details)

Uploaded Python 3

File details

Details for the file python_mip26-2.2.0.tar.gz.

File metadata

  • Download URL: python_mip26-2.2.0.tar.gz
  • Upload date:
  • Size: 11.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for python_mip26-2.2.0.tar.gz
Algorithm Hash digest
SHA256 844674e80745a5f6ae12d5a9c0c38df17885e30d22ba52a8b1bb523f4d55ed77
MD5 f03b3d034ddd181a8a77d4b95f953676
BLAKE2b-256 fb17fa48fd59891de1ff86ff1758fc01a3cab969b67adb1ea002a42dc57a6a63

See more details on using hashes here.

File details

Details for the file python_mip26-2.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_mip26-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff5dff153a14fed65311d6a9e0b8b86415e801a374d3187540d3a62edf74c563
MD5 dd27ed4846d0ee741d5d6dd7596ed1d1
BLAKE2b-256 bad896b012fefbe86b99e87da6afc917111d0c20288f1a6784c58f7d290d72e1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page