Opened 6 years ago

Last modified 6 years ago

#20446 closed enhancement

GLPKExactBackend - a variation on GLPKBackend that sets a solver parameter and signals errors on integer variables — at Initial Version

Reported by: mkoeppe Owned by:
Priority: major Milestone: sage-7.2
Component: numerical Keywords: lp
Cc: dimpase, vdelecroix Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

GLPK has an exact simplex method, which can be requested by setting a solver parameter. Via #20406, a user can set this parameter.

It would be more convenient to define a named backend that does that.

Also, setting the solver parameter actually causes GLPK to solve the continuous relaxation, ignoring all integer variables. This might be surprising to users.

sage: delsarte_bound_additive_hamming_space(19,15,7,isinteger=True)
3
sage: from sage.numerical.backends.generic_backend import get_solver
sage: def glpk_exact_solver():                                               
        b = get_solver(solver="GLPK")
        b.solver_parameter("simplex_or_intopt", "exact_simplex_only")
        return b
sage: delsarte_bound_additive_hamming_space(19,15,7,solver=glpk_exact_solver,isinteger=True)
glp_exact: 54 rows, 20 columns, 795 non-zeros
...
2

So there would be value in a named backend that actually signals an error when the user requests integer variables (like the CVXOpt and InteractiveLP backends do).

sage: delsarte_bound_additive_hamming_space(19,15,7,solver="GLPK/exact",isinteger=True)
ValueError: This backend does not handle integer variables

While at it, could also support the "glp_simplex followed by glp_exact" mode that is mentioned in http://trac.sagemath.org/ticket/18735#comment:7

Change History (0)

Note: See TracTickets for help on using tickets.