-
Notifications
You must be signed in to change notification settings - Fork 34
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
add support for SCIP cardinality constraints #39
Conversation
Hello and thanks for the PR! We do already give miracle access to the scip model object, so we shouldn't have anything to do here to support new scip features. But what would be interesting in good_lp would be to implement this as a trait, with implementations on multiple optimizers. |
this addressess @lovasoa 's comment rust-or#39 (comment) also upgrades russcip dependency to one that supports cardinality constraints.
this makes this version compatible with the code in russcip 0.2.6
this addressess @lovasoa 's comment rust-or#39 (comment) also upgrades russcip dependency to one that supports cardinality constraints.
Hi @lovasoa , thanks for the comment. The trait idea seems a good trade-off, and I pushed an update to the PR. If accepted I think this helps users create constraints using good_lp Variables without understanding the underlying interface of solvers with good_lp. Also rebased to current main. On the other hand, if this is not aligned with good_lp architecture feel free to close this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect! This looks good to me
You can fix the tests (looks like you forgot to run cargo fmt) and I'll merge. |
oops, sorry for that (cargo fmt). thanks for catching & fixing! |
This adds the ability of users to add cardinality constraints when using a SCIP optimizer.
This will also require a Cargo.toml change to a dependency version of russcip with the cardinality support, which is tracked by scipopt/russcip#106 -- so this is not yet ready to merge.
(cardinality constraints allow a user to limit the number of non-zero variables from a given set in the solution to be <= N.)