Skip to content

Conversation

@kaatish
Copy link
Contributor

@kaatish kaatish commented Jun 5, 2025

Updating the constraint bounds based on minimal and maximal activity can sometimes cause the update constraint lower bounds to be greater than constraint upper bounds even if the constraint is feasible within tolerance.

This PR fixes the constraint bounds to the same value if this happens.

@kaatish kaatish added this to the 25.08 milestone Jun 5, 2025
@kaatish kaatish requested a review from a team as a code owner June 5, 2025 17:49
@kaatish kaatish requested review from aliceb-nv and rg20 June 5, 2025 17:49
@kaatish kaatish added bug Something isn't working non-breaking Introduces a non-breaking change labels Jun 5, 2025
@kaatish kaatish self-assigned this Jun 5, 2025
auto new_c_lb = max(c_lb, min_a);
auto new_c_ub = min(c_ub, max_a);
i_t infeas = check_infeasibility<i_t, f_t>(
min_a, max_a, new_c_lb, new_c_ub, pb.tolerances.absolute_tolerance, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pb.tolerances.absolute_tolerance is pretty large: 1e-4 if I remember correctly. I think ideally this would be around 1e-6. Maybe we should introduce a new tolerance here that we can remove later once we bring the absolute tolerance down to 1e-6.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relative_tolerance default value is set to 1e-6. Do you want to just use that? If not, what should I name the new tolerance as?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should add a tolerance called presolve_absolute_tolerance = 1e-6. We can remove it later when we set the absolute_tolerance = 1e-6.

@chris-maes
Copy link
Contributor

Thanks for the fix @kaatish . Would you also be able to add a tolerance to check_var_bounds_sanity and check_constraint_bounds_sanity? We should not throw an error unless the lower bound is greater than the upper bound plus a tolerance.

We also should consider if we should declare the problem infeasible (rather than throwing an exception) if check_var_bounds_sanity or check_constraint_bounds_sanity are triggered on the original problem from the user.

@kaatish
Copy link
Contributor Author

kaatish commented Jun 5, 2025

Thanks for the fix @kaatish . Would you also be able to add a tolerance to check_var_bounds_sanity and check_constraint_bounds_sanity? We should not throw an error unless the lower bound is greater than the upper bound plus a tolerance.

Same as above? Tolerance of 1e-6?

We also should consider if we should declare the problem infeasible (rather than throwing an exception) if check_var_bounds_sanity or check_constraint_bounds_sanity are triggered on the original problem from the user.

I can return a bool from check_bounds_sanity and return false from run_presolve if the check fails. What you are proposing is to add those checks (apart from the checks we already have) before we run trivial_presolve?

@chris-maes
Copy link
Contributor

Thanks for the fix @kaatish . Would you also be able to add a tolerance to check_var_bounds_sanity and check_constraint_bounds_sanity? We should not throw an error unless the lower bound is greater than the upper bound plus a tolerance.

Same as above? Tolerance of 1e-6?

Yes, I would use 1e-6. You can refer to it as presolve_absolute_tolerance.

We also should consider if we should declare the problem infeasible (rather than throwing an exception) if check_var_bounds_sanity or check_constraint_bounds_sanity are triggered on the original problem from the user.

I can return a bool from check_bounds_sanity and return false from run_presolve if the check fails. What you are proposing is to add those checks (apart from the checks we already have) before we run trivial_presolve?

No need to add any additional checks. I'm just proposing we mark the problem as infeasible (rather than throwing an exception) if the check fails before presolve. During presolve if the bounds cross, we should already return Infeasible before calling this check.

@kaatish kaatish requested a review from chris-maes June 6, 2025 04:54
@kaatish kaatish requested review from a team as code owners June 6, 2025 05:29
@kaatish kaatish requested review from AyodeAwe and Iroy30 June 6, 2025 05:29
@kaatish kaatish force-pushed the fix_conditional branch from d0250a3 to d9b5a63 Compare June 6, 2025 05:36
@kaatish kaatish removed request for a team, AyodeAwe and Iroy30 June 6, 2025 05:36
Copy link
Contributor

@chris-maes chris-maes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kaatish
Copy link
Contributor Author

kaatish commented Jun 6, 2025

/merge

@rapids-bot rapids-bot bot merged commit 716502c into NVIDIA:branch-25.08 Jun 6, 2025
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants