PySCIPOpt icon indicating copy to clipboard operation
PySCIPOpt copied to clipboard

Preparing SCIP 10

Open Joao-Dionisio opened this issue 6 months ago • 7 comments

To make the transition to SCIP 10 smoother, I figured I'd take some notes on what needs to be done to ensure compatibility and which functions need to be wrapped.

  • [x] New event types SCIP_EVENTTYPE_IMPLTYPECHANGED, SCIP_EVENTTYPE_DUALBOUNDIMPROVED, SCIP_EVENTTYPE_GAPUPDATED
  • [ ] IISFINDER functions (almost done)
  • [x] Statistics Json functions
  • [x] SCIPvarGetImplType(), SCIPvarIsBinary(), SCIPvarIsIntegral(), SCIPvarIsImpliedIntegral(), and SCIPvarIsNonimpliedIntegral()
  • [ ] Exact SCIP functions
  • [ ] Many many new API functions

Before merging these things, would like to add a bunch of tests as well.

Joao-Dionisio avatar May 29 '25 11:05 Joao-Dionisio

Please also consider support for SCIPvarGetImplType(), SCIPvarIsBinary(), SCIPvarIsIntegral(), SCIPvarIsImpliedIntegral(), and SCIPvarIsNonimpliedIntegral().

DominikKamp avatar May 29 '25 16:05 DominikKamp

Something we might need to look into is that test_pricer seems to fail with SCIP10. Maybe it's only on my machine, though.

Joao-Dionisio avatar Jun 05 '25 14:06 Joao-Dionisio

I guess it is always better to describe the fail instead of only saying that there is one.

DominikKamp avatar Jun 11 '25 09:06 DominikKamp

Ouch, but point taken. I said a bit more in the PR: "The pricer test is also failing. Even with heuristics disabled, it seems that SCIP is finding solutions outside of the pricer."

We're counting every solution the pricer finds, and we get 2 in the end. With model.getNSols we get 3, where up until now we also got 2.

But this was just from surface-level observation, I didn't look into it.

Joao-Dionisio avatar Jun 11 '25 09:06 Joao-Dionisio

No problem, this just makes me nervous, and this way it is easier to handle. In pricerredcost() there is self.model.data["nSols"] = self.model.getNSolsFound() so self.model.data["nSols"] is the number of solutions when pricerredcost() was called the last time. If the optimal solution is found in the last LP, then I would expect the stored number of solutions one less than the number of all solutions but I am not sure why the number of solutions matters.

DominikKamp avatar Jun 11 '25 10:06 DominikKamp

I looked a bit more into it, and it turns out that the trivial heuristic is not disabled even with s.setHeuristics(0). Apparently, the trivial heuristic didn't find anything before.

Oh, just re-read your comment, it's more likely that that's what's happening yeah. Need to think how to adapt the test, though. EDIT: Yeah, not too difficult. Thanks!

Joao-Dionisio avatar Jun 11 '25 10:06 Joao-Dionisio

Try with s.setHeuristics(pyscipopt.SCIP_PARAMSETTING.OFF), 0 means default.

DominikKamp avatar Jun 11 '25 10:06 DominikKamp