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

Refactor and simplify src/MOI/MOI_callbacks.jl #244

Merged
merged 6 commits into from
Mar 20, 2024
Merged

Conversation

odow
Copy link
Member

@odow odow commented Mar 19, 2024

Closes #195

Copy link

codecov bot commented Mar 19, 2024

Codecov Report

Attention: Patch coverage is 98.48485% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 63.73%. Comparing base (62fbcb2) to head (97a66b5).

Files Patch % Lines
src/MOI/MOI_callbacks.jl 98.48% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #244      +/-   ##
==========================================
+ Coverage   63.52%   63.73%   +0.20%     
==========================================
  Files           6        6              
  Lines        3545     3513      -32     
==========================================
- Hits         2252     2239      -13     
+ Misses       1293     1274      -19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

test/test_MOI_wrapper.jl Outdated Show resolved Hide resolved
@odow odow merged commit 00df013 into master Mar 20, 2024
7 checks passed
@odow odow deleted the od/moi-callbacks branch March 20, 2024 01:11
Comment on lines +82 to +84
# If we added a cut from the existing pool, it means that the current
# solution violates a cut that we previously added but that has since
# been deleted.
Copy link
Member

Choose a reason for hiding this comment

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

I think the pont is, there are at leas three thing that might happen when a cut is added in a callback
1 - only added to that node
2 - added to all nodes
3 - only added to a node and its child

Is it the difference between UserCuts and LazyCuts?

Copy link
Member

Choose a reason for hiding this comment

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

at least from 2022, it seems that cuts will be applied to child:

XPRSaddcuts, XPRSaddcuts64
Purpose
Adds cuts directly to the matrix at the current node. Any cuts added to the matrix at the current node and
not deleted at the current node will be automatically added to the cut pool. The cuts added to the cut pool
will be automatically restored at descendant nodes.

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess I don't really see why we need this. If Xpress has removed a cut, then we will at some point visit a violated solution and add a new one. The MOI callbacks do not enforce that once a solution is cut it will never be revisited.

And yeah, the return isn't tested, so I don't think this is actually doing anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants