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

GDP: Don't transform known-to-be infeasible Disjuncts in multiple BigM #3314

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

emma58
Copy link
Contributor

@emma58 emma58 commented Jul 10, 2024

Fixes # .

Summary/Motivation:

It's possible to discover that a Disjunct is infeasible in gdp.mbigm when calculating M values, since we solve each Disjunct for each disjunctive constraint in the same Disjunction. If we discovered that a Disjunct was infeasible during this process, we were deactivating it, but failing to remove it from the list of "active Disjuncts" that we are transforming. So nothing was mathematically wrong, but we were doing extra work transforming Disjuncts that couldn't possibly be selected. And, as a bonus, if you set baron as the solver for calculating M's, you could run into #3313, which is how we figured this out....

Changes proposed in this PR:

  • Converts the active_disjuncts list to a ComponentSet so that it's easy to remove things from it if they get deactivated.
  • Adds a check when solving Disjuncts to calculate M's that we have not encountered a previously-deactivated Disjunct, since we actually deactivate things as we iterate through them.
  • Adds a check in the tests that we don't transform Disjuncts we discover as infeasible during M calculations.

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

emma58 added 2 commits July 10, 2024 13:00
…active Disjuncts after we encountered an infeasible one and deactivated it. Nothing was wrong here, but we were doing extra work (and hitting a bug in the baron writer)
Copy link

codecov bot commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.49%. Comparing base (f5e6f32) to head (6f0d954).
Report is 836 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3314      +/-   ##
==========================================
- Coverage   88.50%   88.49%   -0.02%     
==========================================
  Files         868      868              
  Lines       98427    98430       +3     
==========================================
- Hits        87112    87101      -11     
- Misses      11315    11329      +14     
Flag Coverage Δ
linux 86.30% <100.00%> (-0.01%) ⬇️
osx 75.61% <100.00%> (-0.01%) ⬇️
other 86.49% <100.00%> (-0.01%) ⬇️
win 83.80% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@emma58 emma58 merged commit 9fd504a into Pyomo:main Jul 11, 2024
33 checks passed
@emma58 emma58 deleted the mbm-baron-bug branch July 11, 2024 14:31
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