Keywords: linear programming, LP, GLPK, runtime, test case, Netlib
# 16 Aug 2019 08:34z ~bz/py/opt/lp/netlib Denis-iMac 10.10.5
Intel(R) Core(TM) i5-3330S CPU @ 2.70GHz
Apple LLVM version 7.0.2 (clang-700.1.81)
GLPSOL: GLPK LP/MIP Solver, v4.65 (uses only 1 core)
--------------------------------------------------------------------------------
# glpsol-simplex
# problem rows columns non0 obj seconds
dfl001 5983 10868 34062 1.12664e+07 30.7
pilot87 1968 4593 70380 301.71 6.7
stochfor 15336 14382 55088 -39976.8 4.8
fit2d 25 10500 129018 -68464.3 3.6
maros-r7 2152 5288 98334 1.49719e+06 2.4
fit2p 3000 10525 47284 68464.3 1.9
80bau3b 1992 9166 19823 987224 0.8
cycle 1404 2254 14469 -5.22639 0.1
--------------------------------------------------------------------------------
# glpsol-ip
# problem rows columns non0 obj seconds
fit2p 3001 13525 60784 68464.3 131.6
dfl001 6072 12230 41873 1.12687e+07 37.5 unstable
fit2d 26 10500 138018 -68464.3 24.3
maros-r7 3137 9408 151120 1.49719e+06 7.4
pilot87 2031 4883 73804 301.71 6.0
stochfor 16676 15695 74004 -39976.8 0.4 unstable
80bau3b 2263 9799 29063 987224 0.3
cycle 1904 2857 21322 -4.8844 0.2 unstable
(Simplex has a "Preprocessing" step which makes problems smaller, in some cases a good deal smaller.)
First look at the shell scripts below, see if they make sense.
- download and unpack
https://www.gnu.org/software/glpk/.../glpk-4.65.tar.gz
configure; make; make install
- download
*.mps.gz
fromhttp://www.zib.de/koch/perplex/data/netlib/mps
, seecurls-netlib-zib
. (There are other Netlib repos, some with bit rot.) run-glpsol-netlib my*.mps
- summarize the logfiles with
glpsol.awk
or the like.
-
GLPK ain't bad, on these old test cases.
-
Experts generally say that commercial solvers such as Gurobi are waaay faster than any opensource solver. This wouldn't surprise me, but: data on the table please.
-
Moore's laws (of CPU and memory) are making old test cases irrelevant.
GLPK may be good enough for your problem. In real-world optimization, the LP optimizer is only part of a flow, a cycle, a process:
- input: map a problem to a sea of numbers
A b c [...]
- check that there are no mistakes in this process
- run the LP engine
- output: make the solution
x[...]
understandable for yourself and for others, with plots and talks.
Old runtimes from glpk 4.40: .../glpk-4.65/doc/netlib.txt
in the GLPK distribution
scipy/scipy#9783: a plot of some scipy linprog runtimes, log scale
lp_np
: numpy <--> GLPK, under my gists
It would be nice to have test problems that are small but difficult:
small enough to understand,
but with difficult constraints for simplex / for IP.
(Can one define "ill-conditioned" for LP problems ?
SVD can be used to analyze Ax = b
without x >= 0
,
and construct test cases; is there an analog for LP ?)
cheers
-- denis 19 August 2019