Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In Sage 8.1, I can reproduce your code as follows (notice that I added "ppl" as a solver since the default behavior changed between your post and this answer).

sage: q = MixedIntegerLinearProgram(maximization=False, solver="ppl")
....: x = q.new_variable(integer=True, nonnegative=True)
....: 
....: q.add_constraint(     x[0] == 1)
....: q.add_constraint(88 * x[2] == -306 * x[0] + 1 * x[1])
....: q.add_constraint( 1 * x[3] == 42636 * x[0] + 42 * x[1])
....: q.add_constraint(11 * x[4] == 30804 * x[0] + -42 * x[1])

In order to speed things up, I use normaliz.

(You can install it by typing the commands in a terminal:

sage -i normaliz
sage -i pynormaliz

)

and then use the backend normaliz for the polyhedron:

....: P = q.polyhedron(backend="normaliz")
....: P.integral_points()
....: 
((1, 0, 306, 55488, 1632),
 (1, 1, 394, 59184, 1296),
 (1, 2, 482, 62880, 960),
 (1, 3, 570, 66576, 624),
 (1, 4, 658, 70272, 288))

which should appear instantaneously.