15
$\begingroup$

What are the handiest optimization parsers out there? Is COIN-OR's PyPy being used actively? I am currently trying to do an optimization project in Python, but I am used to using MATLAB + YALMIP combination, so I need some advice!

$\endgroup$
1
  • 1
    $\begingroup$ PuLP hands down (if linear) $\endgroup$
    – Kuifje
    Commented Nov 19, 2019 at 20:38

4 Answers 4

9
$\begingroup$

Given you are a MATLAB+Yalmip user you may prefer Cvxpy. Cvxpy is particularly useful if you do nonlinear models. Mosek also includes 2 Python interfaces where the so called Fusion interface may be the most interesting for you.

Here you find a comparison of Cvxpy, Pyomo and Fusion for some large scale problems.

$\endgroup$
2
  • $\begingroup$ I tried it, that's really like YALMIP. I was overwhelmed with the notation of other parsers, this works great! Note: The documentation of CVXPY says MOSEK can not solve Exponential Cone problems, which is not true anymore I guess, so just flagging here... $\endgroup$ Commented Nov 20, 2019 at 23:25
  • $\begingroup$ We will get it fixed. $\endgroup$ Commented Nov 21, 2019 at 8:20
9
$\begingroup$

I think the two most common are PuLP and Pyomo. Some commercial solvers also have dedicated Python packages, e.g., Gurobipy and docplex.

Related: I've formulated my optimization model; now what?

$\endgroup$
8
$\begingroup$

Handiest optimization package in python is Pyomo(in my opinion). I recommend that because of the following specifications:

  1. There is a google group ( in addition to se and or.se) that you can ask for help if you stacked.
  2. You can use all the pythonic facilities to write your model
  3. There are enough books, tutorials and documents about it.
  4. Pyomo is an active and well developed package.
  5. You can also use many available solvers to solve your model written in Pyomo.
  6. You can easily use solvers on Neos server to solve the model.
$\endgroup$
2
4
$\begingroup$

Pyomo can do a lot. CVXPY is good for convex problems which can be modeled using DCP (Disciplined Convex Programming), including Linear SDPs, and does have certain extensions for certain non-convex problems.

But there is no modeling environment I know of in Python which captures all of YALMIP's capabilities. For instance, I am not aware of any BMI (Blinear Matrix Inequality) capability in Pyomo or any other modeling environment in Python, let alone the capability to solve BMIs and Nonlinear SDPs to global optimality (given enough time).

SO it really depends on the type and variety of problems you wish to solve.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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