FIX: unbounded/infeasible status mismatch for CBC relaxed models #342
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.
Hi, thanks for the awesome work on the library! I believe that I found a small bug in handling of result from CBC relaxed models.
Current version of
python-mip
(tested version 1.15.0 on Apple M1) does not work correctly for the relaxations of following ILPsComparing the
python-mip
CBC solverpython-mip/mip/cbc.py
Lines 1110 to 1113 in 6044fc8
and actual
CBC
code forCbc_solveLinearProgram
https://github.com/coin-or/Cbc/blob/f3a8af7b627ac068853d847c67d05614dcd99d39/src/Attic/Cbc_C_Interface.cpp#L1753-L1761
I concluded that the status codes for infeasible and unbounded programs are swapped in the
python-mip
code. Moreover, looking at CBC code, I believe that status 3 fromCbc_solveLinearProgram
should be interpreted as primal formulation is either unbounded or infeasible (as dual infeasibility may lead primal to be either unbounded or infeasible); however, I could not find documentation for CBC on these status codes so I cannot be certain what the CBC developers meant by this status code. Therefore, I added a followup check for this status code to see whether the primal formulation is infeasible or unbounded.I never worked with CBC before so hopefully I did not miss some detail.