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
238 stars 34 forks source link

Add support for RELP #13

Open lorenzleutgeb opened 2 years ago

lorenzleutgeb commented 2 years ago

I am using good_lp (at the moment with minilp). I am interested in exact solutions for rational numbers, and therefore I would like to experiment with relp. This is a request to add relp, or guide me doing so.

If I understand correctly, a new "type" of good_lp::variable::VariableDefinition (other than the existing types "continuous" and "integer") would be required. Generally, I am not sure how to deal with the discrepancy of f64 vs. the number types in relp_num which relp uses.

lorenzleutgeb commented 2 years ago

cc @vandenheuvel in case you are willing to help.

lovasoa commented 2 years ago

I don't think you need to add a new variable type. But you need to implement all existing operations on variables and expressions with these numbers, and you need to make expression generic to account for the different coefficients it will be able to hold. It will be quite a major change.

https://github.com/rust-or/good_lp/blob/main/src/expression.rs

If you do it, please put it behind a feature flag, so that it does not add a new mandatory dependency.

vandenheuvel commented 2 years ago

I haven't prioritized a nice API yet, so I very much welcome integration into this project. I don't have a lot of capacity at the moment and diving into the inner-workings of good_lp is not something I'm available for, but I'm happy to answer questions or make some adaptations to relp's APIs to ease the integration.

lovasoa commented 1 year ago

Hello ! I just created a CONTRIBUTING.md for this repo, please let me know if it helps, and what to add / improve to make it easier for you.