Add WithMipStart trait and Gurobi MIP start support - #13
Merged
Merged
Conversation
Contributor
|
Happy to merge once ci passes |
Contributor
Author
|
Ah, I hardcoded /tmp in the test instead of handling it via the environment. I'm on it. In the meantime, what do you think about switching from a hash map to an iterator based start solution as in good_lp's WithInitialSolution? In the beginning I thought this was overkill (and the hash map way fitting in better with the existing codebase) but now I think especially for large problems the conversion to hash map and back when calling from good_lp is unnecessary. |
Contributor
|
I doubt there are any cases when the performance impact won't be tiny compared to actually solving the problem. But feel free to prove me wrong ! |
Contributor
|
Thanks, merged ! |
lovasoa
added a commit
that referenced
this pull request
Jan 9, 2026
* Defined WithMipStart trait * Implemented WithMipStart for GurobiSolver * fix test case: Replaced use of hardcoded /tmp directory with temp_dir() call
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for providing a MIP start (partial initial solution) to solvers that can consume one, and wires it into the Gurobi CLI backend by generating a temporary
.mst fileand passing it togurobi_clviaInputFile=....Motivation
Warm-starting MILPs can significantly reduce solve time when a good incumbent or partial assignment is known (e.g., from a previous solve or a heuristic algorithm). This is also requested downstream at the
good_lppackage (rust-or/good_lp#111).Changes
Example Usage
Notes
.mstfile is persisted in the system temp directory (similar to how “temporary” solution output paths are handled in the crate right now).InputFile=entries, as Gurobi indicates it can do, (e.g., hints.hnt, basis.bas)