cobratoolbox icon indicating copy to clipboard operation
cobratoolbox copied to clipboard

New solver status when residual tolerance not met in solveCobraQP?

Open pauljensen opened this issue 5 years ago • 4 comments

https://github.com/opencobra/cobratoolbox/blob/f3fe20df5c977cf0d212e12b1763bd96d15c8760/src/base/solvers/solveCobraQP.m#L601

I appreciate that solveCobraQP checks the max residual in the solution. However, I don't think raising an error is the best solution when a violation occurs. Perhaps we should define a new solver status code to indicate feasTol was not met, similar to when a model is infeasible or unbounded.

Otherwise, developers needs to wrap calls to solveCobraQP in a try/catch and assume any errors came from L601. They should already be checking for non-optimal solver status codes and can handle these cases.

pauljensen avatar Apr 11 '19 00:04 pauljensen

For this case, I believe it is just the optimality condition not met and the comparision should be made with optTol instead of feasTol. But I agree in general. Since different solvers have different status code and have different special solution conditions, it will be a good idea to have a cobra function to check the feasibility and even the optimality of the returned solution for all problem types. By the way, @pauljensen , did you use gurobi and encounter this situation: gurobi said the QP solution was optimal but it did not pass the optimality test here? I encountered a situation like this and I guess it might be a bug of gurobi. When the solver method was set to automatic, the dual values returned by the solver seemed to be problematic (I manually checked the feasibility and optimality conditions) while the solution is fine, therefore not passing the manual optimality check in solveCobraQP. However, when I set the method to any one of the primal simplex, dual simple or barrier. The dual values returned by gurobi were perfectly fine and the optimal solution returned was the same.

shjchan avatar Apr 11 '19 03:04 shjchan

That's interesting, @shjchan . I get this error with Gurobi (8.1.1) only using automatic or barrier methods. Primal/dual simplex works fine.

pauljensen avatar Apr 11 '19 12:04 pauljensen

I get this with CPlex as well, running MOMA. I don't have much further detail.

akaviaLab avatar Apr 25 '19 11:04 akaviaLab

Cplex issue may be different than gurobi... https://github.com/opencobra/cobratoolbox/issues/1464

On Thu, 25 Apr 2019 at 07:57, akaviaLab [email protected] wrote:

I get this with CPlex as well, running MOMA. I don't have much further detail.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/opencobra/cobratoolbox/issues/1459#issuecomment-486642104, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQMEOVNPI6GMEV6URCHHOLPSGMDXANCNFSM4HFCDOXA .

--

Mr. Ronan MT Fleming B.V.M.S. Dip. Math. Ph.D.

Assistant Professor, Division of Systems Biomedicine and Pharmacology, Leiden Academic Centre for Drug Research, Faculty of Science, Leiden University. https://www.universiteitleiden.nl/en/staffmembers/ronan-fleming & H2020 Project Coordinator Systems Medicine of Mitochondrial Parkinson’s Disease http://sysmedpd.eu

Peer-reviewed publications: https://goo.gl/FZPG23 Mobile: +353 873 413 072 Skype: ronan.fleming

(This message is confidential and may contain privileged information. It is intended for the named recipient only. If you receive it in error please notify me and permanently delete the original message and any copies.)

rmtfleming avatar Apr 26 '19 02:04 rmtfleming