# What sparse linear programming solver it is better to use?

I have the following LP problem:

$$\min \limits_{\varepsilon, x_{1}, \ldots, x_{n}}f(\varepsilon, x_{1}, \ldots, x_{n}) = \varepsilon \;\;\;\;\; s.t. \;\;C x \geq 0, \;\; x_{i}^{0} - \varepsilon \leq x_{i} \leq x_{i}^{0} + \varepsilon$$

where $C$ is $m \times n$ matrix, and $x$ and $x^{0}$ are vectors of dimension $n$.

$C$ is very sparse matrix, each its row contains only $4$ non-zero values.

The typical case is $m = 15000$ and $n = 5000$.

Can anybody advise any LP-solver that can provide the best performance for this problem?

• Python is not hard to learn. I would suggest Gurobi using the Python interface. – Sergio Parreiras Jun 11 '14 at 13:48

The best performance solvers are probably Gurobi or CPLEX; last I checked, Gurobi is slightly faster, but both are competitive. These two commercial solvers are roughly ten times faster than the best open-source solvers.

That said, as AC_MOSEK points out, your problem is small enough that essentially any functioning LP solver based on sparse data structures (i.e., most of them) will work. Instead of locking your implementation into a specific solver, if you can, I suggest implementing your problem in an optimization framework like GAMS or AMPL, or using an LP-specific modeling framework such as PuLP or Coopr. These frameworks are geared towards making it easy for you to input your problem in a solver-independent, math-like format, so you can experiment with different formulations and solvers rapidly. Then, after settling on a formulation and solver combination that works best for you, you can implement it in a lower-level language for speed for that formulation and specific solver.

• Thanks, @GeoffOxberry, do you mean that it's possible to give different solvers to optimization frameworks, i. e. without big modification in the program itself? Is it possible to do it using Matlab? If there is no difference for me, what framework is better? – Ilya Palachev Apr 2 '14 at 4:45
• Yes, it is possible to give different solvers to optimization frameworks without extensive modifications (maybe one to two lines). It might be possible to do using MATLAB, but you would likely need to buy that capability (TOMLAB might have an LP modeling framework). If you know Python, PuLP is lightweight and easy to learn; Coopr is more powerful, but takes more time to learn. If you don't know Python, I would use GAMS. You can download a free copy for small problems, and submit large problems through the NEOS server. – Geoff Oxberry Apr 2 '14 at 21:12
• The problem is that I don't exactly know what formulation to use. Because LP problem may be used just for finding first approximation for the QP problem: $\min ||h - h^{0}||^{2}_{2} \;\; s. t. Q h \geq 0$. So I have doubt that LP-based frameworks can help with this. The current idea is to use some LP solver to find first approximation and then give it as input to Ipopt algorithm, using Eigen as an angine for matrix multiplcation, needed for Ipopt. Also I have heard that algorithm PDCOcan solve it in 1 sec – Ilya Palachev Apr 3 '14 at 7:42
• GAMS and AMPL are modeling languages designed for general-purpose optimization, not specifically for LPs, so these frameworks would still be of use to you. If you intend to use a QP formulation, Gurobi and CPLEX also have QP solvers, and these would also be better than open-source alternatives. Eigen is not a dependency of IPOPT; BLAS and LAPACK libraries are. Using optimized BLAS and LAPACK libraries (vendor-specific, GotoBLAS/OpenBLAS, ATLAS), plus a linear solver such as HSL (or MUMPS, you should experiment with both, if possible) would be better courses of action. – Geoff Oxberry Apr 3 '14 at 18:29
• Thanks, @GeoffOxberry, and have you ever heard anything about PDCO method? – Ilya Palachev Apr 4 '14 at 5:12

Your problem seems fairly easy, I would say that any reasonable LP solver should solve it in seconds. So it might be more a choice related to API's, price, licensing. Try out MOSEK, CPLEX or GUROBI among the commercial ones, or CLP from the coin-or project. You can find a list on Wikipedia

http://en.wikipedia.org/wiki/Linear_programming