bug in bigm transformation with set objects #1101
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary/Motivation:
When creating a constraint using the index set of another constraint combined with another set, the index set of the original constraint gets modified unintentionally. See the following example:
This creates a bug in the BigM transformation in
pyomo.gdp
. This PR fixes this problem by wrapping the original index set in alist()
when creating the new constraint.This is may not be the correct fix. We may need a fix in the Constraint constructor or somewhere in Sets. However, the new Set rewrite may fix this problem. @jsiirola What is your suggestion on how to proceed? Is this the correct fix until the set rewrite is complete or should I go ahead and try to fix the underlying problem?
Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: