-
Notifications
You must be signed in to change notification settings - Fork 24
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
Expose callbacks for various SCIP plugin types. #94
Comments
See also discussion in jump-dev/CPLEX.jl#207 for a candidate interface that could be used as a template. |
My personal motivation would be to expose constraint handler plugins first (in full generality) with a thin convenience wrapper (à la lazy constraint callback), in the coming weeks. Then heuristics, and (much?) later the other plugin types. |
I'd like to brainstorm how to expose constraint handler plugins in full generality without SCIP needing to depend on JuMP. Could you give a brief summary of what callbacks are needed to implement a constraint handler? I remember there are multiple functions to implement. |
For constraint handlers, there are 3-4 required callbacks:
There are two versions of In addition, there are lots of optional callbacks: Some of these are for data bookkeeping (memory mgmt, copies of data, transformation during presolve etc), others algorithmic ( Looking at the documentation, I'm now hesitant with my previous claim of "full generality" ;-) EDIT: I have not thought about any JuMP interaction, actually. I only skimmed over the discussions about generic callbacks in GLPK, CPLEX etc., saw that it was possible and decided to look up the code as needed. |
If I understand correctly, after you register a constraint handler for X-type constraints, you can add arbitrarily many X-type constraints, right? Do we want to support this, or should we blur the abstraction and say that if you want to enforce X-type constraints, the one constraint handler has to know all the data (which is more like how lazy constraints work)? For the former, we could model X-type constraints through a new MOI function. So you could register a constraint handler and then independently add X-type constraints. Just throwing ideas out. I'd say we should first focus on a clean MOI implementation and then the JuMP interaction should follow from that. |
That is correct, although it is also optional. So, for example, with a constraint handler for subtour elimination, it might only make sense to have a single constraint in the problem. I think there is a boolean flag like I think it makes sense to support it. That way, the same kind of constraint could be applied, say, to different blocks of a model. Also, it might even make the interface to JuMP easier, if a user has to hand some data explicitly into the constraint, such as a list of variables. Rather than adding an MOI function, it could also be an MOI set, right? That's what I did for the |
From the docs:
Maybe my example of subtour elimination does not fit the recommended use. In that case, would suggest to have an explicit constraint, in even in the case of subtour elimination. So far, when adding new features, there have been three layers, typically:
In the case of constraint handlers, it might also make sense to have a more-or-less complete interface at the |
To keep track of the progress here, most of the announced ones are done, what would be missing is a more MOI-like way of doing it with abstract submittables or at least optimizer attributes done:
to do:
|
edited the status above, I don't think there is much left to do except improving the constraint handler to make it easier to access |
Since SCIP support for plugins (callbacks) is more general that what is available in other MIP solvers, it makes sense to offer a thin layer around the SCIP style of them, for example:
If/when a callback interface is established for MOI, this layer could be used then.
The text was updated successfully, but these errors were encountered: