Add support for Absolute/Relative gap tolerances
I went for the easy way: fall back to the RawOptimizerAttribute
EDIT: I have updated the PR to follow the conclusions of https://github.com/jump-dev/MathOptInterface.jl/issues/1936
At the moment, the present branch only works with MOI#master
Should I mark RelativeGap as supported around here?
Hmmmmmm. I don't know if we've ever classified RelativeGap as a settable attribute. It's not solver-independent because every solver implements it differently.
It's not solver-independent because every solver implements it differently.
That's already the case for the getter part, and there's a warning for that in the MOI docs.
That being said, RelativeGap is currently a AbstractModelAttribute. I'm wondering whether its usage as a tolerance would count as optimizer attribute? Would that warrant some sort of differentiation?
Yeah so the difference is:
-
ModelAttributes are typically part of the solution information. In this case,is_set_by_optimize(::RelativeGap) = true: https://github.com/jump-dev/MathOptInterface.jl/blob/bcc869f09bc3916683c6d296237ba5bfe25aa6f9/src/attributes.jl#L1968 -
OptimizerAttributes are things like solver parameters.
So RelativeGap is really "what is the gap of the final solution," rather than the solver parameter that controls the relative gap. You could see there might be a difference, when if you set RelativeGap, what you get back might be smaller than that.
I'll move the high-level discussion to the MOI issue. I'll update this PR based on whatever is decided there.
I'll update this PR to use MOI.AbsoluteGapTolerance and MOI.RelativeGapTolerance
PR updated. Only works on MOI#master at the moment.
Waiting for MOI v1.7 to be released, which will include the definitions of RelativeGapTolerance and AbsoluteGapTolerance as OptimizerAttributes.
I have updated the compat entry for MOI to 1.7.