9
$\begingroup$

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.

$\endgroup$
  • 3
    $\begingroup$ Take a look at the answer to this question: I've formulated my optimization model; now what?. You'll get to know commercial and open-source solvers, each with a Python API. And if you're looking for packages that call open-source solvers, check out this question: Interface for Cbc - COIN-OR $\endgroup$ – EhsanK Jan 27 at 14:03
  • 1
    $\begingroup$ In my opinion PuLP is outstanding : pypi.org/project/PuLP $\endgroup$ – Kuifje Jan 27 at 20:56
  • $\begingroup$ All the commercial solves have Python interfaces. I think mosek is a good one since I build it. $\endgroup$ – ErlingMOSEK Jan 28 at 6:32
  • 1
    $\begingroup$ The MIPCL solver has a nice interface on python and easy to use. I think easier than other solvers with good performance. $\endgroup$ – A.Omidi Jan 28 at 8:16
  • $\begingroup$ I didn't know that for MIP codes, there is a separation between modeling language and solver. Also, I'm not interested in commercial software. I edited the question to make this clear. $\endgroup$ – DeltaIV Jan 28 at 13:01
7
$\begingroup$

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

| improve this answer | |
$\endgroup$
7
$\begingroup$

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.

| improve this answer | |
$\endgroup$
  • $\begingroup$ I second this, Pyomo is great and automatically connects to any solver with an ASL interface (which is most of the COIN-OR stuff). $\endgroup$ – Nikos Kazazakis Jan 28 at 14:02
4
$\begingroup$

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.

| improve this answer | |
$\endgroup$
2
$\begingroup$

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.

| improve this answer | |
$\endgroup$
  • 5
    $\begingroup$ SCIP is not open source. You cannot use it freely for commercial use for instance. See the license agreement. $\endgroup$ – ErlingMOSEK Jan 29 at 8:04
  • $\begingroup$ Pulp is actually not a solver but a modeling framework - will update my answer accordingly. $\endgroup$ – CMichael Jan 29 at 19:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.