relp

Crates.iorelp
lib.rsrelp
version
sourcesrc
created_at2021-05-12 21:34:08.717145
updated_at2024-10-01 13:58:04.198866
descriptionRust Exact Linear Programming
homepage
repositoryhttps://github.com/vandenheuvel/relp
max_upload_size
id396686
Cargo.toml error:TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Bram van den Heuvel (vandenheuvel)

documentation

README

crate documentation build status codecov

RELP: Rust Exact Linear Programming

A framework to describe and solve linear programs exactly, written in Rust. Linear programming is a modelling technique to solve the wide range of optimization problems that can be represented by linear constraints and a linear target function.

This repository houses the library. Do you just want to solve a linear program stored in a file from the command line? See relp-bin.

Usage

Add this to your Cargo.toml:

[dependencies]
relp = "0.2.6"

You'll probably want to use the number types provided by the relp-num crate, so include that dependency as well:

relp-num = "0.1.13"

You can now use both crates, for example to read a linear program in the classic MPS format in arbitrary precision:

fn main() {
    let path = std::path::Path::new("my_program.mps");
    let my_program = relp::io::import::<relp_num::RationalBig>(path);
}

Features

Describing LPs

Linear programs are described through a constraint matrix, right-hand side vector and cost function. You can provide these explicitly, but Relp also offers the MatrixProvider trait which can be implemented to represent your problem. You can find an example implementation of this trait for the shortest path and max flow problems in the examples/ directory. You can capture the specific properties of your problem by implementing additional traits, such as the PartialInitialBasis trait in case you know a partial initial basis for your problem.

Solving LPs

Relp provides standard solve procedures for implementors of the aforementioned MatrixProvider trait through the SolveRelaxation trait: simply call problem.solve_relaxation() with that trait in scope. When additional traits are implemented, will the problem-specific properties they represent be exploited by faster solve procedures, seemlessly hidden behind that same call.

For more advanced use cases, it is also possible to replace some of the solve default algorithms. You can, for example, implement your own pivot rule or basis factorization.

Roadmap

  • Two-phase simplex algorithm
  • Lazy column generation
  • LU decomposition
  • Steepest descent pricing
  • Presolving framework
  • Prescaling framework
  • Integer variables through Gomory cuts
  • Floating point support
  • Branch and bound
Commit count: 180

cargo fmt