I have been using PuLP for linear optimisation. By default, on OS X, the library used the packaged COIN command line program. This tends to be slow if you are many optimisations as I was doing. Luckily PuLP can handle other optimisers as well like GLPK or paid ones like CPLEX or GUROBI.
So I decided to install GLPK on my computer. This proved harded than I initially imagined.
Installing GLPK Homebrew and swig:
Now to install python bindings for GLPK. I tried out two binding for python (more details here):
- Python-GLPK
- PyGLPK
I didn’t have any success with PyGLPK. So I stuck with Python-GLPK.
My instructions:
Firstly install ‘ply’
Then download the code and unzip it.
In swig/Makefile replace line number 1 to
In folder ‘src’, run
I got these errors and I ignored them.
Now run:
This should install the library. To test if the install worked, go to the examples directory