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

[Bridges] add tests for deleting variable in bridged objective #2156

Merged
merged 2 commits into from
May 1, 2023

Conversation

odow
Copy link
Member

@odow odow commented Apr 26, 2023

Closes #2153

@blegat everything looks okay to me.

@blegat
Copy link
Member

blegat commented Apr 26, 2023

So suppose you have x'*U'*U*x + a'x <= ub and you delete x_1.
Before, the RSOC constraint was (1, -a'x + ub, U*x) and after you should have (1, -a'x[2:end] + ub, U[:,2:end] * x[2:end]) with the current implementation.
However, each row r of U for which U[r,:] is now zero should be dropped if you want to match the transformation that you would have if you restart the bridging after deleting the variable. This mismatch might be confusing for the user.

@odow
Copy link
Member Author

odow commented Apr 26, 2023

I dunno. Having to delete the row of a constraint if it goes to zero because you deleted a variable is a much bigger change.

This mismatch might be confusing for the user.

But equally, there was a row in the constraint matrix. We deleted the variable so the row stills stays. If it was the only variable, the row is now zero. That seems straightforward.

@odow
Copy link
Member Author

odow commented Apr 27, 2023

An example is that if you had 1.0 * x in GreaterThan(0.0), you wouldn't expect Gurobi to delete the row just because you deleted the x variable.

@blegat
Copy link
Member

blegat commented Apr 27, 2023

I doesn't make sense to delete the row if you delete the variable that's why it won't work if you don't delete the quadratic term and bridge again. For the bridge, since the transformation is internal, it does make sense to simplify if the user remove quadratic terms.

@odow
Copy link
Member Author

odow commented Apr 27, 2023

For the bridge, since the transformation is internal, it does make sense to simplify if the user remove quadratic terms.

That just seems like added complications for minimal benefit. Can we merge these tests, and wait for someone (other than you) to complain? I bet no one even notices.

@odow odow closed this May 1, 2023
@odow odow reopened this May 1, 2023
@odow odow merged commit a0f221e into master May 1, 2023
@odow odow deleted the od/test-delete-variable branch May 1, 2023 20:01
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.

Variable deletion with bridges
2 participants