Conversation
|
Yes, I would be happy to merge both versions of the interface! |
|
Updated the interface somewhat, it seems SCIP does not have the fancy Min/Max/Abs constraints built-in in its API : / Added the SOS1 and cardinality constraints to the interface too, these constraints are created when decomposing alldiff for example so definately usefull to have them imho. We should also add them to the Gurobi interface SolveAll is in a weird state for PySCIPOpt: SCIP does allow for retrieving all feasible solutions, but the Python interface does not seem to allow for collecting the solutions which are found... Added the issues to track in the code so we can add the specialized implementation when these are resolved. All tests are passing so ready for review I think. |
|
I get an error for optimization problems: |
This should now be addressed in one of my points above |
|
@IgnaceBleukx @tias I haven't run anything, and truthfully haven't tried to understand the larger code base, but I've gone through and given comments that I think should make the interface work. |
|
SCIP PR ready for review with some notable update:
Most notably, I ran pytest-cov to get a coverage on what lines of codes are actually touched by the CI. It's very instructive. If a line of code is not run by CI, either the test for it is missing, or more likely, it is dead code. This left to the following simplifications:
Recommend checking out the reports below for an older code cov (htmlcov-bak/scip.html) report (from running |
tias
left a comment
There was a problem hiding this comment.
very nice and clean, made some minor tweaks and minor comments
(also a less minor comment that is just triggered by the review, need not be for the PR)
| return has_sol | ||
|
|
||
|
|
||
| def solver_var(self, cpm_var): |
There was a problem hiding this comment.
do we do this function the same elsewhere?
its not written with 'fast path' in mind... an alterantive would be
solver_var = self._varmap.get(cpm_var, None)
if solver_var = None:
if is_num...
elif is _BoolVarImpl:
if NegBool: raise
else:
solver_var = ...
elif _IntVarImple:
self._varmap[cpm_var] = solver_var
return solver_var
if other solvers do similar like we do here, we should fix this in a separate PR
- Now similar to Gurobi - Also, `getObjective` should always return Expr according to scip docs
|
@tias fixed comments (and I can't request your review since you started the PR) |
with help of Mark Turner from SCIP.
Now... turns out that @IgnaceBleukx already worked on a SCIP interface too, about a year ago (e.g. SCIP branch
So maybe Ignace can now make a best of both worlds? : )
(current branch is up to date with current template, but the add part is minimal, e.g. reified linear is not properly tested/supported at the least).