What libraries should I use for linear programming in python? [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this questionA quick search on "python linear programming" turns up a lot of hits (e.g. this one). Looking through them, I see a fair number of complaints about outdated dependencies, poor documenta开发者_如何学JAVAtion, etc.
Can anybody recommend a headache-free (e.g. fast, well-documented, easy-to-install, clean API) linear programming library for python?
I'd recommend looking at PULP and/or Pyomo.
cvxopt is written by Lieven Vandenberghe and some of his collaborators. (This is the same Vandenberghe of the widely used convex optimization textbook by Boyd and Vandenberghe.) It's a general convex conic programming solver, and uses an interior point method. On the plus side it's well-documented, has many examples, and is easy to use. I believe it scales fairly well, though not as well as commercial products like Xpress, Gurobi, or cplex.
Looks like there's a pull request to scipy containing a (pure python) linear programming implementation, though. So a linear programming solver could be in scipy in the future.
You might look at PuLP from the coin-or set of libraries.
http://www.coin-or.org/projects/
I don't know what you are specifically trying to do, but NumPy/SciPy are the usually first places to look for anything math related in Python.
You can also take a look at or-tools, which includes a wrapper around widely used linear solvers such as GLPK.
As of 2015, scipy includes a method to solve linear programming models directly through scipy.optimize.linprog. It uses the Simplex algorithm.
精彩评论