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

How can I set model/solver options, especially for HiGHS ? #18

Closed
lucidfrontier45 opened this issue Sep 13, 2022 · 1 comment
Closed

Comments

@lucidfrontier45
Copy link
Contributor

lucidfrontier45 commented Sep 13, 2022

I tried to set time limit option but I found there is no way to call highs::Model::set_option .

With good_lp API the only chance I can get an instance of highs::Model is to call good_lp::solvers::highs::HighsProblem::into_inner as solve does internally.

pub fn into_inner(self) -> highs::Model {

Then I can have several set_option calls and at the end solve method call. Even though I still cannot have HighsSolution instance as solution: highs::Solution field is private and HighsSolution does not have any explicit constructor like new method.

pub struct HighsSolution {

Can you give me any suggestion to simultaneously use good_lp API as well as set Highs options?

Thank you.

@lovasoa
Copy link
Collaborator

lovasoa commented Sep 13, 2022

Good_lp offers the into_inner escape hatch if you need to work with a raw Highs instance. But if you use it, you are then on your own, and have to use highs directly to get your solution.
I don't think it would be a good thing for good_lp to let you do anything you want with the model, and then take it back as if nothing happened. The model you give back could have nothing to do with the one good_lp initially handed out to you !
However, if there are options that are safe to use within good_lp, please open a pull request to add support for them directly in good_lp !

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

No branches or pull requests

2 participants