-
Notifications
You must be signed in to change notification settings - Fork 562
Add remove_nodes method to IncidenceGraphInterface
#2240
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
Codecov Report
@@ Coverage Diff @@
## main #2240 +/- ##
=======================================
Coverage 83.05% 83.05%
=======================================
Files 607 607
Lines 76968 77000 +32
=======================================
+ Hits 63923 63955 +32
Misses 13045 13045
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
jsiirola
left a comment
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.
I think this is OK, but there is a small change that you can make to make the API a little more flexible,
…nto incidence-remove
remove method to IncidenceGraphInterfaceremove_nodes method to IncidenceGraphInterface
Summary/Motivation:
When debugging a model that has an unexpected overconstrained or underconstrained subsystem, a common task we want to do is remove a particular variable and constraint from the incidence graph/matrix, the equivalent of fixing a variable and deactivating a constraint. This can help narrow down the "cause" of the unexpected overconstrained/underconstrained system. This is currently possible by fixing/deactivating, then re-constructing the incidence graph, but would be nice to do this without altering the Pyomo model. This motivates the addition of a method on
IncidenceGraphInterfacefor removing nodes from an incidence graph. Note this is "projecting" variables and constraints out of the model, rather than doing some sort of vertex elimination (where new edges/nonzeros would be added to the graph).Changes proposed in this PR:
removemethod toIncidenceGraphInterfacethat removes columns and rows corresponding to provided variables and constraints from the cached incidence matrixLegal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: