# Linear Programming in Python with CVXOPT

In a previous post, I compared the performances of two Linear Programming (LP) solvers, COIN and GLPK, called by a Python library named PuLP. It then took around 100 ms to solve problems of moderate size. As it turns out, this is way too slow for this kind of problems, probably due to the fact that PuLP calls solvers externally via the command line. In this second post, I used the CVXOPT library and compared the performances with the previous approach. As it turns out, using CVXOPT is 50~70 times faster! Where it took 100 ms with PuLP, it now takes 2~3 ms with CVXOPT on my machine.

## CVXOPT setup

If you don't plan on using external solvers such as GLPK or MOSEK, installing CVXOPT on Ubuntu or Debian is as simple as:

$sudo apt-get install python-cvxopt  To install GLPK as well, you'd best build from source. An easy way to get everything done automatically is to use pip: $ sudo apt-get install libglpk-dev