ERGO-Code / HiGHS

Linear optimization software
MIT License
957 stars 177 forks source link

Clarify meaning of `kHighsStatusWarning` in `Highs_run` #1562

Open amigalemming opened 9 months ago

amigalemming commented 9 months ago

I am uncertain how to cope with kHighsStatusWarning of Highs_run. It seems to be returned in cases where the optimization result is unreliable. But what is the difference to kHighsStatusError? Is there a function to get more information about the meaning of the warning? I'd like to see a clarification in highs_c_api.h or in the documentation.

jajhall commented 9 months ago

This warning flag indicates that something unusual has happened, but that the problem has been solved OK.

I'll add a comment to this effect in the documentation.

amigalemming commented 9 months ago

In #1561 I get kHighsStatusWarning but the result deviates considerably from the result that finished with kHighsStatusOk, thus I guess, it is wrong.

jajhall commented 9 months ago

OK I'll get to the bottom of this when I investigate #1561

jajhall commented 9 months ago

Having looked at your example from #1561, to be more precise Highs_run(highs) returning kHighsStatusWarning indicates that something unusual has happened, but that the problem may have been solved OK. To determine this, the user should look at the model status and number of primal and dual infeasibilities.

jajhall commented 9 months ago

Beyond looking for logging lines with the prefix "Warning", here is no current way for users to identify retrospectively the reason for the kHighsStatusWarning return. The same is true for kHighsStatusError. The difference between the two is that when Highs_run(highs) returns kHighsStatusError, it is known that the solve has failed