'm looking for smallish test cases for which the simplex algorithm is slow, preferably AMPL.
I gather that the [Klee-Minty cube](
https://en.wikipedia.org/wiki/Klee-Minty_cube)
is bad theoretically -- 2^D vertices for `A` D x D --
but cplex runs D=100 in ~ 0 seconds.
Can anyone point me to other LP problems that run slowly in student AMPL,
simplex or interior-point, not MIP ?
(Klee-Minty is so badly scaled, `xopt` 0 ... 0 5^D`,
that several of the solvers in student AMPL fail e.g. with max 0.
Maybe I missed options to prescale ? grep scal doc/README* -> only cplex minos xpress.)
Add this to your collection of silly corner cases:
# Klee-Minty-cube.mod see
https://en.wikipedia.org/wiki/Klee-Minty_cube # D vars, D constraints, 2^D vertices => slow simplex ?
# badly scaled, xopt 0 .. 0 5^D => numerical problems for some solvers
param D default 100;
set I := {1 .. D};
set J := {1 .. D};
param b{i in I} := 5. ^ i;
param c{j in J} := 2. ^ (D - j);
param A{ i in I, j in J } =
if i < j then 0 else
if i == j then 1
else 2. ^ (i - j + 1); # lower diagonals 4 8 ...
# scale A ?
#...............................................................................
var x{J} >= 0;
maximize z: sum {j in J} c[j] * x[j];
subject to rows {i in I}:
sum {j in J} A[i,j] * x[j] <= b[i];
solve;
printf "Klee-Minty-cube D=%d: max %g x[D] %g should both be 5^D := %g \n",
D, z, x[D], 5^D;