9

Following the accepted answer to

Assignment problem where assignments must be done sequentially

I would like to write a Python script which can solve the problem defined there. It's a Mixed Integer Linear Programming problem, thus I need an Open Source MILP solver, and a modeler. The constraints are probably very simple for you guys, but since I'm not familiar with MILP, it would be great if the modeler had an intuitive, easy to use API. Can you indicate me a Python modeler and solver which I can use to solve the problem? If you could also help me describing the MILP problem in the question above, using the modeler API, that would be great.

DeltaIV
  • 255
  • 1
  • 6

4 Answers4

7

I'm not a Python user, but I've heard good things about Pyomo, which is an open-source modeling language. In addition to Pyomo, you would need a solver program (from among those they support), but you would not need to worry about any syntax issues related to the solver.

prubin
  • 39,078
  • 3
  • 37
  • 104
  • I second this, Pyomo is great and automatically connects to any solver with an ASL interface (which is most of the COIN-OR stuff). – Nikos Kazazakis Jan 28 '20 at 14:02
7

I find Pulp is extremely easy to use, versatile and has good performance. Check it out here: https://pythonhosted.org/PuLP/solvers.html

CMichael
  • 1,333
  • 6
  • 20
4

A more recent alternative is Python-MIP. It has built-in support of COIN-OR CBC. In addition, right now it supports one commercial solver, namely Gurobi. According to its website, it provides access to advanced solver features like cut generation, lazy constraints, MIP starts and solution pools. Since Python-MIP is mentioned on the COIN-OR projects webpage, it seems that Python-MIP is going to be open source in the long run.

Ehsan
  • 2,463
  • 10
  • 26
2

As suggested above, PULP is one of the open source solver. Apart from this, the best MILP solver available in open source is preferably offered in SCIP optimization suite. I think Google OR tools are built using SCIP only. Moreover, you can refer to COIN-OR where researchers from ORMS society have maintained their projects.

Divyam Aggarwal
  • 668
  • 3
  • 10