-
Notifications
You must be signed in to change notification settings - Fork 199
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
example for LP warm start? #617
Comments
There are various warm/hot start facilities in HiGHS, and I'm sorry that the documentation is lagging behind development. As you suggest, HiGHS will automatically use warm/hot starts if it can, so all that a user has to do is call run() after changing a model (using HiGHS methods). I've realised from your question that this simplicity is obscured by the existence of get/setHotStart and (un)freezeBasis. The latter methods are sophisticated levels of hot start that were written for the HiGHS MIP solver - which uses its own instances of the HiGHS class. If you're just changing the RHS of constraints, (using changeRowsBounds) after a default solve (ie not using the interior point solver) then HiGHS will recognise that the modified problem can be solved using the optimal solution (basis and basis matrix factorization, if you're familiar with these issues) of the original problem. The same is true if you change variable costs or bounds. The more you change an LP, the more has to be done to take advantage of its optimal solution when re-solving, but HiGHS will do all it can invisibly. There are some situations where it is better to use an optimal basis saved from solving another LP, and this can be done with get/setBasis. Until we've got extensive documentation - we're a very small team and the current priority is MIP solver performance - I'll see that there are a few more comments in examples like call_highs_from_cpp.cpp. Thanks for your patience and I hope that, otherwise, HiGHS is proving to be satisfactory! |
Comments added to Highs.h, indicating (un)freezeBasis and get/setHotStart as advanced methods: for HiGHS MIP solver |
Hi, I am interested in using hot-start, however after reading the comments above I am not sure how yet. Let's suppose I have the following code:
Before the step 5, I'd expect some sort of initial solution passing. Does the second run get automatically hot started? How can I hot start a model with an already feasible solution that I have? (independently of previous runs) thanks, |
If you've only got a feasible point, then set it up as a HighsSolution instance
and HiGHS will do its best to form a basis for the LP solver. |
Is this possible via highspy at this stage? To pass a single starting feasible solution for a model to the solver. Looking in the |
I've added 'highs_passSolution' to 'highs_bindings.cpp', but it's still in the 'latest' branch, and releases are generated using 'master'. For Linux (and Mac?), if you can install HiGHS 'latest' from source using the documentation on https://ergo-code.github.io/HiGHS/dev/interfaces/cpp/, ensuring that LD_LIBRARY_PATH includes CMAKE_INSTALL_PREFIX/lib, then you can install highspy locally as follows In ~/HiGHS/highspy, run pip install ../. |
Thank you @jajhall |
Hi, I'm having trouble finding documentation on how to properly do a warm-start with the HiGHs solver. Looks like it's called "hot start" in the code, but it's not clear exactly how it should be used, especially when changing the right-hand side of the constraints. I assumed that the MIP solver would be using it, but I didn't see any references to a warm/hot start in the MIP code.
Is there an example anywhere? Is it as simple as calling get/setHotStart?
edit: after experimenting, looks like the
Highs
object (C++ interface) automatically uses warm/hot starts.The text was updated successfully, but these errors were encountered: