-
Notifications
You must be signed in to change notification settings - Fork 271
Add getNBranchings and getNBranchingsCurrentRun #1049
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
Conversation
Let me know when you want a review. For now, it seems you need to |
Should be good now, thank you ! |
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.
Pull Request Overview
This PR adds two new methods to the Variable class for tracking branching statistics: getNBranchings()
and getNBranchingsCurrentRun()
. These methods provide access to SCIP's internal counters for how many times a variable's bounds have been changed due to branching decisions.
- Implements
getNBranchings()
to get total branching count for a variable in a given direction - Implements
getNBranchingsCurrentRun()
to get branching count for the current solving run only - Adds corresponding SCIP C function declaration and comprehensive test coverage
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/pyscipopt/scip.pxd | Declares the SCIP C function SCIPvarGetNBranchingsCurrentRun |
src/pyscipopt/scip.pxi | Implements both new Variable methods with proper documentation |
tests/test_vars.py | Adds test cases for both new methods and imports required constants |
CHANGELOG.md | Documents the addition of the new methods |
Can you please provide a more complex test, where the number of branchings is nonzero? |
Co-authored-by: João Dionísio <[email protected]>
Co-authored-by: João Dionísio <[email protected]>
I have changed the tests. Now they solve a MIP before testing that the sum of branchings for all the variables is correct. |
Thank you! Will just disable restarts, since future SCIP versions can change the number of restarts. By the way, with suggestions you can just press "commit suggestion" and it's easier for both you and me :) |
No description provided.