Great to see OR highlighted here! Thank you for sharing.
The syntax demonstrated is very similar to the syntax of other libraries, including the python tools provided by Gurobi [1].
For experimentation and rapid prototyping LP, QP, MIP and geometric programming problems, I highly recommend CVXPY [2]. CVXPY allows the user to select a solver. Among the solvers is GLOP [3].
For modelling libraries in general-purpose languages, Gurobi's python bindings have the best reputation. But of course Gurobi is very expensive (I have heard about $50k for a fully unrestricted license, plus $10k yearly for support). On the open-source side, besides Google's OR-Tools, there is Pyomo [1] and PuLP [2] in Python (as the article mentions). In Julia, there is JuMP [3], whose development community is extremely enthusiastic.
Traditionally, however, mathematical models were encoded in domain-specific languages. The most prominent one is AMPL [4] which is proprietary. The glpk [5] people have developed a very neat open source clone of AMPL: the GNU MathProg language. For a more modern take on AMPL-type modelling DSLs, look at ZIMPL [6], which is open source as well.
I’ve used pulp a lot to set up MIP problems in python. The problem is that every variable often uses 10kb of memory or so. When problems get large, the machine that I have that has access to gurobi will run out of memory juts setting up the problem in python (or when calling gurobi from within python, which for a short time seems to double memory usage when calling an external process) - even though gurobi can still handle the actual model.
I’ve often given up and just build the problems in python by outputting text files, which is very cumbersome.
I wonder whether there’s a better alternative, i.e. a python library that will deal well with large problems.
Cvxpy is what you're looking for, your variables and constraints can be defined as numpy arrays, it's game changing. It also has a giant selection of solvers, is open source and actively developed, and even has tensorflow integrations
I don't know if it's applicable to your use case, but if you work on these models a lot you might want to consider using Minizinc/Flatzinc as a modeling language.
Nothing against python, but those models get unwieldy very quickly, especially when there are tons of overlapping constraints popping up.
Well, I usually use MIP in larger processing pipelines, which I tend to write in python. For example see step 4. in this algorithm about automatically generating a public transit map layer:
https://site.transitapp.com/how-we-built-the-worlds-pretties...
Use cvxpy, much nicer api and you can drop numpy arrays into it so your optimizations can be one line instead of awful lists of constraint objects. Also it can be a tensorflow layer now with cvxlayers
The syntax demonstrated is very similar to the syntax of other libraries, including the python tools provided by Gurobi [1].
For experimentation and rapid prototyping LP, QP, MIP and geometric programming problems, I highly recommend CVXPY [2]. CVXPY allows the user to select a solver. Among the solvers is GLOP [3].
[1] https://www.gurobi.com/resource/modeling-examples-using-the-...
[2] http://cvxpy.org
[3] https://www.cvxpy.org/tutorial/advanced/index.html#choosing-...