rust-or / lp-solvers

library implementing interaction with various linear programming solvers
https://docs.rs/lp-solvers/
MIT License
17 stars 9 forks source link

Implementing MIP gap #5

Closed mfuhr closed 10 months ago

mfuhr commented 10 months ago

I propose implementing a trait with a name like WithMipGap to set the MIP gap for solvers that support it (e.g., --mipgap for GlpkSolver). Any objections? I'd think the gap value should be f64 or f32 so it would be signed -- should the setting method check that the value is >= 0.0 or should it pass the caller's value as-is to the solver?

lovasoa commented 10 months ago

It sounds like you know mip solvers better than I do, and I currently do not have a lot of time to allocate to this project. Can I give you write access to this repository ?

As a general advice, I'd say the value should not be passed as it. The function to set the gap can either clamp it, or return an Err when the value is negative.

mfuhr commented 10 months ago

I'm pretty new to both Rust and GitHub so I'm hesitant to make changes myself without somebody else checking my work. I don't mind doing the work and submitting a PR, though.

lovasoa commented 10 months ago

Giving you access does not prevent you from making PRs and asking for feedback :)

It just means that when I am not around anymore, there is still someone to prevent this crate from rusting :)

mfuhr commented 10 months ago

Sure, feel free to give me write access if you'd like. I'm not sure how much time I'll have in the future but right now I have a bit of time to play with optimization in Rust.

mfuhr commented 10 months ago

Should I close this issue myself now that the PR has been merged and closed? What about increasing the version in Cargo.toml? Doesn't good_lp also need to update its Cargo.toml to use the new version of lp-solvers?

Thanks!

lovasoa commented 10 months ago

If we do a minor version change, it will still be compatible with good-lp without any change there

lovasoa commented 10 months ago

You can update the cargo.toml here and push a new tag, the new version should be pushed to crates.io automatically

lovasoa commented 10 months ago

Ok, I bumped this crate to 1.0.0 to make future maintenance easier, and I published good-lp v1.4.3 which depends on it.