Skip to content
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 cardinality constraints #106

Closed
wants to merge 2 commits into from
Closed

Conversation

yonch
Copy link
Contributor

@yonch yonch commented Sep 3, 2023

This adds support for SCIP cardinality constraints, which constrain solutions to have at most N non-zeros out of a set of variables (see https://www.scipopt.org/doc/html/cons__cardinality_8h.php).

This follows the others add_cons_* implementations in the crate, and adds a (passing) test.

scip-sys already has the relevant functions wrapped, so this is ready to be merged.

A follow up pull request to good_lp relies on this PR, so if possible, maintainers should consider making a named release, for good_lp to depend on.

@codecov
Copy link

codecov bot commented Sep 3, 2023

Codecov Report

Merging #106 (3d93a06) into main (667ad6c) will increase coverage by 0.20%.
The diff coverage is 84.21%.

@@            Coverage Diff             @@
##             main     #106      +/-   ##
==========================================
+ Coverage   75.01%   75.22%   +0.20%     
==========================================
  Files          13       13              
  Lines        1669     1707      +38     
==========================================
+ Hits         1252     1284      +32     
- Misses        417      423       +6     
Files Changed Coverage Δ
src/scip.rs 84.62% <66.67%> (-0.63%) ⬇️
src/model.rs 92.64% <100.00%> (+0.37%) ⬆️

Copy link
Member

@mmghannam mmghannam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the useful contribution! I added some small comments, otherwise would be ready to merge.

src/model.rs Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants