GLPKMathProgInterface.jl icon indicating copy to clipboard operation
GLPKMathProgInterface.jl copied to clipboard

passing parameters

Open stumarcus314 opened this issue 7 years ago • 7 comments

How does one pass in time limit, absolute optimality gap, and relative optimality gap stopping condition parameters to GPLK when using const solver = GLPKSolverMIP() ?

stumarcus314 avatar Mar 08 '18 00:03 stumarcus314

You should be able to pass options as keyword arguments to the constructor. The available ones are documented in the GLPK manual (available at http://www.gnu.org/software/glpk), section 2.10.5 "glp intopt — solve MIP problem with the branch-and-cut method", paragraph "Control parameters". For example, the time limit is tm_lim (passed as an integer number of milliseconds).

carlobaldassi avatar Mar 08 '18 12:03 carlobaldassi

Great thanks a lot! Does GLPK have an absolute optimality gap? The user manual states that mip_gap is the relative optimality gap.

stumarcus314 avatar Mar 12 '18 15:03 stumarcus314

Sorry, I don't know more that what's in the manual...

carlobaldassi avatar Mar 12 '18 17:03 carlobaldassi

Are there plans to implement methods setparameters! from MathProgBase as well?

This would mean handling the two cases of TimeLimit and Silent.

rschwarz avatar Jun 24 '18 18:06 rschwarz

No plans I'm aware of; MPB is deprecated. A MOI wrapper for GLPK is not far off (https://github.com/JuliaOpt/GLPK.jl/pull/53). It will then be a bit more work to expose these as MOI optimizer attributes.

mlubin avatar Jun 24 '18 19:06 mlubin

OK. I just saw that setparameters!(s::GLPKSolverMIP; mpboptions...) and setparameters!(m::GLPKMathProgModelMIP are implemented, but the corresponding methods for LP are not. I will try to add them in my own code.

Unfortunately, I will still need to run code based off MPB during the next couple months, because of callbacks and because I need it now :smirk:

rschwarz avatar Jun 24 '18 19:06 rschwarz

I will still need to run code based off MPB during the next couple months, because of callbacks and because I need it now

That's understandable :). PRs accepted if you'd like to add setparameters! for the LP solver.

mlubin avatar Jun 24 '18 19:06 mlubin