-
Notifications
You must be signed in to change notification settings - Fork 95
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
FIX: unbounded/infeasible status mismatch for CBC relaxed models #342
base: master
Are you sure you want to change the base?
Conversation
@modosist Thanks for fixing this bug. Would you please add the tests you posted to the code base? |
Sure, I will prepare some tests! Hopefully I will get to it within a week. BTW: I found out that similar issue is also within Gurobi wrapper (although it is not related to relaxed models) Lines 777 to 778 in 6044fc8
However, this one probably needs more discussion: should |
Yes, and something related happens with the (WIP) HiGHS wrapper as well. The status codes from the solver and the Lines 1005 to 1008 in 9082252
|
Might be closely related to this here #285 |
I added a few tests for the relaxed models. The tests will fail on Gurobi (and looking at code from @rschwarz , HiGHS should fail as well). I will address the remaining solvers in another issue. |
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.