You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I do not immediately see a Disjunctive/NoOverlap constraint (but I am well aware we can use Cumulative for that).
We would love to interface to these constraint handlers from our CPMpy library. Would it be possible to add them to PySCIPOpt? Or is there a reason not to?
We could help out if you think its a good idea to add it, and you have some pointers of where to start.
Hey @tias , thank for the issue! Always happy when SCIP/PySCIPOpt comes up in the wild 😁
PySCIPOpt's initial focus was more on modeling (and some plugin work as well), but we've seen people interested in more advanced use cases. SCIP internally upgrades constraints into more specialized constraints (like cumulative constraints), but advanced users still want more control (for example #941 with knapsack constraints).
For this reason, in #977 I'm tracking the constraints that have/have not yet been ported into PySCIPOpt, and indeed cumulative constraints are there, there hasn't been much progress. But the process of adding a new constraint handler is simple, once it's done the first time, it's very mechanical. So, here are the steps:
1 - Edit scip.pxd with the SCIP methods you want PySCIPOpt to call. For example, SCIPcreateConsCumulative():
3 - Add and interface any other related methods you think are sensible (maybe SCIPgetVarsCumulative(), I don't know)
4 - Add the stubs to scip.pyi for type hints. For now, something like:
5 - Add a test that calls the added PySCIPOpt methods to the appropriate test file (or create a new one, if you think it makes sense).
6 - Add a CHANGELOG entry.
7 - Create an MR
And that's it! A couple details are ommited from steps 2 and 3, but it's just about copying addConsAnd(), I believe. What do you think?
Activity
Joao-Dionisio commentedon May 27, 2026
Hey @tias , thank for the issue! Always happy when SCIP/PySCIPOpt comes up in the wild 😁
PySCIPOpt's initial focus was more on modeling (and some plugin work as well), but we've seen people interested in more advanced use cases. SCIP internally upgrades constraints into more specialized constraints (like cumulative constraints), but advanced users still want more control (for example #941 with knapsack constraints).
For this reason, in #977 I'm tracking the constraints that have/have not yet been ported into PySCIPOpt, and indeed cumulative constraints are there, there hasn't been much progress. But the process of adding a new constraint handler is simple, once it's done the first time, it's very mechanical. So, here are the steps:
1 - Edit
scip.pxdwith the SCIP methods you want PySCIPOpt to call. For example,SCIPcreateConsCumulative():2 - Edit
scip.pxiwith the interface to these methods. Something like (simplified):3 - Add and interface any other related methods you think are sensible (maybe
SCIPgetVarsCumulative(), I don't know)4 - Add the stubs to
scip.pyifor type hints. For now, something like:5 - Add a test that calls the added PySCIPOpt methods to the appropriate test file (or create a new one, if you think it makes sense).
6 - Add a
CHANGELOGentry.7 - Create an MR
And that's it! A couple details are ommited from steps 2 and 3, but it's just about copying
addConsAnd(), I believe. What do you think?Joao-Dionisio commentedon Jun 5, 2026
Solved via #1223