optlang interface for the HiGHS solver - #282
Conversation
supports LP and QP, but QP performance is as good as OSQP
|
This is awesome thanks so much. I also was planning this to eventually replace GLPK as reference implementation because it actually supports all solver types (LP, QP, MIP). Will take me a bit to go through everything but I am excited for it. |
Well, you can also thank Claude for it ;-). I mostly directed the implementation towards using the solver object as ground truth and to make it possible to set up everything without the need for symbolic expressions (which still can be used if required). |
cdiener
left a comment
There was a problem hiding this comment.
Great job. Everything works well. Also passes the cobrapy tests. FVA is quite a bit slower than GLPK but this seems to be an intrinsic Highs thing. Resolve even with basis recycling is slower it seems.
One thing I would like to have is the to_lp and from_lp methods implemented and use them for setstate and getstate. Right now serialization uses JSON which is quite slow. As this is imported for switching solvers (clone) it would be good to have the same strategy as CPLEX (serialize through the .lp).
Thanks again for this. Really cool!
Yes, I noticed that too, but there is a simple explanation for this: GLPK runs a primal simplex by default,, while HiGHS runs a dual simplex. If one sets HiGHS to primal simplex the speed of both is about the same. I think this is something that should taken into account on the cobrapy side. |
According to interface.py |
That's what I thought as well. Might make sense to set |
It's used when setting the solver via Would also be nice to have the This is just a feature though. We can also add this later. |
I will be on vacation for the coming three weeks and will get back to it then. |
Have a great vacation. If you are fine with it, I would already merge it as is and then we can follow up with an additional PR. That way I can start testing it a bit more in COBRAPY and MICOM. |
supports LP and QP, but QP performance is not as good as OSQP
possible long-term alternative for GLPK, which seems not to be actively developed any more
no integer variables/MIP support yet, but in principle possible with HiGHS
test script is included