Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Absolute/Relative gap tolerances #484

Merged
merged 5 commits into from
Aug 31, 2022

Conversation

mtanneau
Copy link
Contributor

@mtanneau mtanneau commented Jul 5, 2022

I went for the easy way: fall back to the RawOptimizerAttribute


EDIT: I have updated the PR to follow the conclusions of jump-dev/MathOptInterface.jl#1936
At the moment, the present branch only works with MOI#master

@mtanneau
Copy link
Contributor Author

mtanneau commented Jul 5, 2022

Should I mark RelativeGap as supported around here?

@odow
Copy link
Member

odow commented Jul 5, 2022

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.

@mtanneau
Copy link
Contributor Author

mtanneau commented Jul 5, 2022

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?

@odow
Copy link
Member

odow commented Jul 5, 2022

Yeah so the difference is:

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.

@mtanneau
Copy link
Contributor Author

mtanneau commented Jul 5, 2022

I'll move the high-level discussion to the MOI issue. I'll update this PR based on whatever is decided there.

@mtanneau
Copy link
Contributor Author

I'll update this PR to use MOI.AbsoluteGapTolerance and MOI.RelativeGapTolerance

@mtanneau
Copy link
Contributor Author

PR updated. Only works on MOI#master at the moment.

@mtanneau mtanneau changed the title Add setter for MOI.RelativeGap attribute [DNMY] Add support for Absolute/Relative gap tolerances Jul 18, 2022
@mtanneau
Copy link
Contributor Author

mtanneau commented Aug 6, 2022

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.

@mtanneau mtanneau changed the title [DNMY] Add support for Absolute/Relative gap tolerances Add support for Absolute/Relative gap tolerances Aug 6, 2022
@odow odow closed this Aug 31, 2022
@odow odow reopened this Aug 31, 2022
@odow odow merged commit e5ee627 into jump-dev:master Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants