coin-or / Clp

COIN-OR Linear Programming Solver
Other
396 stars 82 forks source link

Start ClpSimplex solver from user-defined solution? #132

Open constantinosTsirogiannis opened 4 years ago

constantinosTsirogiannis commented 4 years ago

Hi and thanks for all the great work in developing CLP,

I have the following question:

I want to solve an LP problem for which I already have calculated somehow (not with CLP) a solution S that I consider to be "very good". I want now to use ClpSimplex to find the optimal solution for this problem but, to save runtime, I would like to inject S to the ClpSimplex object because I believe it is already pretty close to optimal. Is this possible to do anyhow with the current interface? I see that there a few functions involving a hotstart/warmstart but these have to be calculated by another ClpSimplex object already. Instead of that, is it possible to inject my own manually-calculated solution to the ClpSimplex object?

Thanks in advance,

--Constantinos

Iain-R commented 3 months ago

Hi, were you ever able to do this? It is something that I am interested in as well. Thanks !

jjhforrest commented 3 months ago

To do a warm start you need to set structurals to values. Getting the correct basis is also important but does not have to be accurate. I attach a program (hurriedly put together) which does something with primal. So I ran as warmstart netlib/25fv47 1800 which gets the problem 25fv47 feasible and nearly optimal. I then use this as a warmstart. If you save -1800 it will still do 1800 iterations to get a warmstart but will not put any structurals in basis. See if this example helps in any way warmstart.cpp.txt

Iain-R commented 3 months ago

Thank you very much for this, this seems to solve my issue. I really appreciate the hard work of everyone developing and maintaining CLP