-
Notifications
You must be signed in to change notification settings - Fork 40
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
feat: time limits and solution statuses #89
base: main
Are you sure you want to change the base?
Conversation
@mmghannam you might be interested in this |
cool ! |
done ! |
@KnorpelSenf , you have been pushing a lot of great PRs lately. Would you like to be granted commit access to this repo, in order to participate to its maintenance on the long run ? |
Sure thing, thank you! |
let sol = pb.solve().unwrap(); | ||
assert_float_eq!(sol.value(v), limit, abs <= 1e-8); | ||
} | ||
|
||
const VARIABLE_COUNT: usize = 75; | ||
const CLAUSES: &[(i32, i32, i32)] = &[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please let me know if you have a better idea than this
@lovasoa please check out rust-or/highs#24. After it is released, I can revert 66662fb and then this is ready. |
TimeLimit, | ||
/// The solution is not optimal and it was obtained because the gap limit | ||
/// was reached | ||
GapLimit, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would ideally like to do
GapLimit, | |
GapLimit(f64), |
to communicate the actual gap of the solution but I think the underlying bindings for CBC and SCIP don't expose this data yet.
I mostly think this would be better library design but I honestly don't ever need this myself … so I might just not do it?
Marking this as draft to make sure this isn't merged until we release highs |
Feel free to undo when the dependencies point to stable highs |
Probably wise, I'll do that myself from now on |
It is currently possible to set time limits for individual solvers.
This pull request introduced a generic API to set this for all solvers that provide implementation for this. Currently, CBC, HiGHS, and SCIP are supported. HiGHS bindings depend on rust-or/highs#24, so this PR temporary switches to HiGHS from GitHub. As soon as rust-or/highs#24 is merged, this commit can be reverted.
These changes also include a way to read the solutions even when the solving process was halted early due to a time limit. A new status on the solution lets developers differentiate between optimal solution and solutions reached via time limit.
Also, it aligns how MIP gaps are handled with the newly introduced solution status.