Upgrade HighsInt to int64_t - #3239
Conversation
|
Are you saying that people are specifying integer variables with upper bounds larger than Rather make the modifications to use We're never going to solve the LPs if the optimal values of variables with these vast bounds are anything like
This would also address these concerns |
fwesselm
left a comment
There was a problem hiding this comment.
@Opt-Mucca, I like the idea. But, if the main goal is to avoid a stall, could we just treat bounds whose absolute value is greater-equal kHighsIInf as infinite?
| mipsolver.mipdata_->getDomain().col_lower_[col]), | ||
| static_cast<HighsInt>( | ||
| mipsolver.mipdata_->getDomain().col_upper_[col]), | ||
| mipsolver.mipdata_->getDomain().col_upper_[col] != kHighsInf, |
There was a problem hiding this comment.
Could we just replace this line by:
mipsolver.mipdata_->getDomain().col_upper_[col] < kHighsIInf
| mipsolver.mipdata_->getDomain().col_upper_[col]), | ||
| static_cast<HighsInt>( | ||
| mipsolver.mipdata_->getDomain().col_lower_[col]), | ||
| mipsolver.mipdata_->getDomain().col_lower_[col] != -kHighsInf, |
There was a problem hiding this comment.
mipsolver.mipdata_->getDomain().col_lower_[col] > -kHighsIInf?
For integer variables, I agree strongly that any bounds greater-equal Do I assume correctly that there's no integer cast of bounds on "pure discrete" constraints - those where all the nonzero coefficients involve discrete variables? |
|
@fwesselm I'm going to close this PR in favour of yours. Thank you for saving me from falling down an unnecessary rabbit hole.
@jajhall I'm not sure if I understand the question completely. Attempted answer for what I think it is: The bounds are rounded to some Edit: Missed the first comment
Yes. That was the cause of the infinite loop in the |
I was just trying to think laterally - that maybe there's some integer technique that converts a constraint's data to Which PR of @fwesselm do you mean? |
I have no doubt this can be done with some C++ magic.
A soon to be PR* (@fwesselm mentioned wanting to check out the overflow possibility a bit more): latest...fwesselm:HiGHS:stallFindLurkingBounds |
I see this now, and it's still necessary |
Description
There's currently issues for instances where users pass explicit bounds larger than
kHighsIInfbut that aren'tkHighsInfin reduced cost fixing, e.g., 1e+18. When we castdoubletoHighsInt, we're ending up withkHighsIInfthat will overflow during some future computations. This leads to an infinite loop.@fwesselm I'm a bit concerned that I am still missing cases here. I think I'm still leaving some fringe cases active, e.g., if exactly
std::numeric_limit<int64_t>::max()is passed. Feel free to point anything out or make changes yourself (I'm not the greatest at this) I can email you the instance if interested.Checklist
latestbranch