GurobiPy
GurobiPy is a Python frontend for Gurobi, a powerful ILP solver. Gurobi is expensive, as it could be argued it is the best ILP solver, but there are free student licenses. (This probably depends on what school you go to, but Cornell either pays for Gurobi or gets it for free.)
There aren't too many benefits or drawbacks necessarily from using GurobiPy over OR-Tools (or vice-versa), outside of maybe the fact that with GurobiPy you can interface more directly with the solver, using commands that directly tell Gurobi how much output to show, etcetera. But OR-Tools' more intuitive (according to some) syntax might make up for this.
Installation
You can install GurobiPy with the following command in your terminal:
python -m pip install gurobipy
.
Alternatively, you could install GurobiPy manually, or with Anaconda (via conda
). For documentation on Python installation options, see the official Gurobi website: Gurobi website.
If you don't have pip
installed, read instructions on installing it here: pip website.
If you don't have Python installed, download it here (Python website), or use Anaconda instead.
Usage
Documentation on the GurobiPy interface can be found here: https://www.gurobi.com/documentation/9.5/refman/py_python_api_details.html. This site is a pain to look through, so you may want to look through the examples linked below instead. If you do want to wade through the API details, you'll want to start with the model
object.
Examples
Examples of GurobiPy can be found on this wiki page, under "ILP Formulation Examples": https://orpy.wiki/concepts/index.html