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

[Utilities] add support for VariableIndex in ModelFilter #2315

Closed
wants to merge 2 commits into from

Conversation

odow
Copy link
Member

@odow odow commented Oct 22, 2023

Closes #2308. But I don't really like this. I think it's better just to delete variables after the copy---that will ensure we delete the appropriate constraint coefficients, etc.

@odow
Copy link
Member Author

odow commented Oct 23, 2023

The more I think about this, the less I like it. Deletion is the way to go.

@blegat
Copy link
Member

blegat commented Oct 23, 2023

The issue is that it's also unclear what to do with constraints that have these variables, remove them or replace the variable with zero ?
In the first case, we could have to alter ListOfConstraintIndices as well but we don't want to do that unless we know the filter is removing variables. So I'd add an option specifying SET_VARIABLE_TO_ZERO, REMOVE_CONSTRAINTS_WITH_VARIABLE (in that case, it cannot be in the objective) or KEEP_ALL_VARIABLES.
By default, we have KEEP_ALL_VARIABLES and we error if the filter remove any variables from the list (to let the user know he also need to specify that option).

@odow
Copy link
Member Author

odow commented Oct 23, 2023

The issue is that it's also unclear what to do with constraints that have these variables, remove them or replace the variable with zero ?

Yes. But there are just too many complications. We don't need to support this because the user can just delete variables after the fact.

@odow odow closed this Oct 23, 2023
@odow odow deleted the od/variable-filter branch October 23, 2023 18:46
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.

[Utilities] Add support for filtering variables in ModelFilter
2 participants