-
Notifications
You must be signed in to change notification settings - Fork 24
MOI callbacks #156
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
Comments
True. Since SCIP constraint handlers need to implement 3-4 different callbacks (see comment in #94), there is not a faithful representation of them as a single lazy constraint callback. One approximation would be to
This is what we did in MPB/CSIP, but it's somewhat pessimistic (too many variable locks) and maybe confusing ( |
From what I see from the issue, the only point of ambiguity is on a lock strategy? As I understand them, the only variables for which lock is true would be the ones used either in the constraint or in the condition to check the constraint? |
Yes, the constraint handler must add locks to all variables where changing the assignment (e.g. rounding) to a lower or higher value might violate the constraint. EDIT: So, it's safe to always lock all variables in both directions. |
To come back to this issue, three possibilities I see:
|
I like the last option best, because it's still convenient for the user, but they are aware that there is a decision to be made. |
I'm not sure where option 2 would be located in terms of compromises and advantages, do you know of anyone who has used it for similar use cases? |
I have not used |
If SCIP doesn't have a nice way of meeting |
So @rschwarz the way forward will be to implement the lazy callbacks based on https://github.com/SCIP-Interfaces/SCIP.jl/blob/master/src/conshdlr.jl but at the MOI level? The current functions are fairly low-level for MOI users |
To be honest, I don't have a good idea about how to improve the usability here. I feel like users should know and understand the SCIP principles, in order to achieve correctness without surprises. Given that, any kind of syntactic sugar or sensible defaults might not add a lot of value. In that sense, it's good enough for my own use case. But it might mislead users to think that the callbacks work the "same way" as with other solvers. So, if there will be any compatibility layer, it should be generous with warning messages. |
What about the user-cut callback? It should be possible to support it via SCIP separators. And as there is only a single mandatory callback for separators, it is not misleading for users. Or am I missing something there? |
Yes, I believe that user-cut callbacks should not lead to interface mismatch. Similary, the primal heuristic callbacks should also be relatively straight-forward (with sensible defaults for the timing). |
Is there any chance, that this will be implemented within the next 2-3 months? I would need it for my current project. |
I'm not going to volunteer for it, but I can review pull requests and answer questions. |
Ok. I will try then. Thank you! |
I finished implementing the user-cut callbacks, however I have difficulties with testing. So two questions about that:
|
Re 1: I'm not sure about forcing, but according to the docs you should be able to set the Re 2: I can think of two ways:
Feel free to open a PR, even if it's not yet ready to be merged, then we can discuss details there. |
I think it makes sense to close this, even though other MOI callbacks are not (yet) supported. We can add new issues or PRs that are more specific, as needed. |
Now that callbacks have been shipped in MOI, they can be implemented with the constraint handler system. A good example is GLPK or CPLEX: https://github.com/JuliaOpt/CPLEX.jl/blob/master/src/MOI/MOI_callbacks.jl
The text was updated successfully, but these errors were encountered: