scipopt / russcip

Rust interface for SCIP
https://crates.io/crates/russcip
Apache License 2.0
30 stars 10 forks source link

Constraint Handler Plugin #130

Open mmghannam opened 3 months ago

mwien commented 3 months ago

I'm also very interested in this and might try to find the time to contribute here (though I don't have much experience yet)...

mmghannam commented 3 months ago

Hi @mwien! Thanks for considering to contribute! @egaban also has told me he's interested in this so maybe you can collaborate on it if you want.

I will try to layout an implementation plan here to try to save you as much time/effort as possible. This works for any plugin (I think).

  1. SCIP plugins are essentially interfaces. So first step would be to check the plugin's (fundamental) callbacks from SCIP's documentation and write an interface that represents it. Here's the one for the constraint handler plugin.
  2. SCIP saves PLUGIN_DATA for each plugin type. This is what russcip uses to wrap the struct that implements the interface. You'd need to add an include_{PLUGIN_NAME} method on Model<ProblemCreated> that takes a box of this interface and defines the C callbacks. As a reference you can take a look at the pricer plugin implementation and it's include method.

Hope this helps!

mwien commented 3 months ago

Thanks, that helps a lot :)

egaban commented 3 months ago

Hi! I'm struggling with the C api TBH. I'm trying to implement a constraint handler in C initially to learn how to do that, and then defining the rust interface