rust-or / good_lp

Linear Programming for Rust, with a user-friendly API. This crate allows modeling LP problems, and lets you solve them with various solvers.
https://crates.io/crates/good_lp
MIT License
216 stars 35 forks source link

Add Gurobi Support #20

Open ctriley opened 1 year ago

ctriley commented 1 year ago

I was wondering if this library could be made to call Gurobi by partnering with the already existing https://github.com/ykrist/rust-grb

lovasoa commented 1 year ago

This library can already use gurobi through the lp-solvers feature flag.

One could add a direct binding, but it would be harder to test on ci without a valid gurobi license...

MartinBagaram commented 3 months ago

How do you intercept the LP file generated when using lp-solvers? I just want to build the LP model and then use it with multiple commercial solvers of my liking.

mfuhr commented 3 months ago

How do you intercept the LP file generated when using lp-solvers? I just want to build the LP model and then use it with multiple commercial solvers of my liking.

The to_lp_file_format, display_lp, and to_tmp_file methods of the LpProblem trait might be helpful.

MartinBagaram commented 1 week ago

@mfuhr Is there a minimum code example of how to do this? I have not managed to generate the LP file. I also think this should be an option for the user to just generate the LP file. Thank you