Skip to content
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

Extract solutions at the end of mathopt solve for OrtoolsMathOptMilpSolver + HiGHS #354

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

nhuet
Copy link
Contributor

@nhuet nhuet commented Dec 16, 2024

By default, we extract on the fly the solutions in a callback to feed to any potential user callback.
However ortools/mathopt wrapper around HiGHS currently does not support callbacks (ignore them actually).
So we extract rather the solutions from the mathopt SolveResult returned by mathopt.solve().
More precisely we add some options to OrtoolsMathOptMilpSolver.solve():

  • store_mathopt_res: to store the SolveResult object (containing stats but also a kind of copy of the result storage), False by default
  • extract_solutions_from_mathopt_res: by default False except when using HiGHS. Will construct the final result storage from the mathopt result object (with solutions in reversed order to be consistent with what is returned usually). NB: we still extract on the fly solutions in the callback as:
    • it will do nothing in HiGHS as never called,
    • it is necessary for the user callback if it is actually called.

…olver + HiGHS

By default, we extract on the fly the solutions in a callback to feed to
any potential user callback.
However ortools/mathopt wrapper around HiGHS currently does not support
callbacks (ignore them actually).
So we extract rather the solutions from the mathopt `SolveResult`
returned by `mathopt.solve()`.
More precisely we add some options to `OrtoolsMathOptMilpSolver.solve()`:
- `store_mathopt_res`: to store the  `SolveResult` object (containing
  stats but also a kind of copy of the result storage), False by default
- `extract_solutions_from_mathopt_res`: by default False except when
  using HiGHS. Will construct the final result storage from the mathopt
  result object (with solutions in reversed order to be consistent with
  what is returned usually).
  NB: we still extract  on the fly solutions in the callback as:
  - it will do nothing in HiGHS as never called,
  - it is necessary for the user callback if it is actually called.
@g-poveda g-poveda merged commit 944cca0 into airbus:master Dec 17, 2024
10 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants