2

I have implemented a pure binary integer combinatorial optimization routine within a Python module (importing gurobipy), and experimented with relaxing a few constraints so some variables may assume values 0, 1 or 2, until I ran first into time-to-result latency problems then into memory problems. That initial effort was based on Gurobi, which I discovered on that occasion... and liked, because it has provisions to build thread-safe compute environments when multi-threading, and it offers a model namespace in which the analyst may write out constraints and the objective function and embed them in code.

I now need to replace the Gurobi solver because my earlier installation is reaching its free one-year term limit. I would like to be able to call a FOSS ILP/MIP solver into my python module. Although I saw a couple of references to lpsolve() (e.g. here), my issue is that I really don't know what is and what isn't available out there for Python v3.9+ environments.

I am looking for a stable solver (no beta implementation) with a Python API.

SecretAgentMan
  • 1,895
  • 2
  • 13
  • 39
Cbhihe
  • 123
  • 4

1 Answers1

4

You can use HiGHS, SCIP and CBC solvers with using PYOMO or other Pyomo supported solvers. Also you can use google or-tools CP solver if you write CP model, google CP solver is very powerfull. PYOMO and GurobiPY have similar modelling structure. For example:

  • Model defining: Gurobi: model = gurobipy.Model("LP Example") Pyomo: model = pyomo.ConcreteModel()

  • Variable adding: Gurobi: x = model.addVar(name="x") Pyomo: model.x = pyomo.Var(within=NonNegativeReals)

If you compare gurobipy and pyomo models side-by-side, you can see similarities and convert easily.

Before deciding solver, you can find performance benchmark of free and commercial solvers on here.

kur ag
  • 815
  • 5
  • 14
  • As commented before to @joni, I will start with pySCIPopt and continue with Pyomo. Thank you. – Cbhihe Oct 25 '23 at 07:25