Closed yonch closed 9 months ago
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.
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.
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 https://github.com/scipopt/russcip/pull/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.)