oximo-highs
HiGHS LP/MILP backend for oximo.
Wraps the highs crate (HiGHS bundled, no separate install required). Supports LP and MILP model kinds.
Usage
Most users should depend on the umbrella oximo crate with the highs feature (enabled by default):
[]
= "0.1"
To use this crate directly:
[]
= "0.1"
= "0.1"
= "0.1"
Quick example
use *;
use ;
use ;
let m = new;
let x = m.var.lb.build;
let y = m.var.lb.ub.build;
m.constraint;
m.constraint;
m.maximize;
let result = Highs.solve.unwrap;
assert_eq!;
println!; // 34.0
println!; // 6.0
println!; // 4.0
Options
HighsOptions is a typed builder. All methods return Self for chaining.
| Method | Type | HiGHS option | Default |
|---|---|---|---|
.time_limit(Duration) |
universal | time_limit |
none |
.threads(usize) |
universal | threads |
none |
.verbose(bool) |
universal | output_flag, log_to_console |
none |
.mip_gap(f64) |
HiGHS-only | mip_rel_gap |
none |
.presolve(HighsPresolve) |
HiGHS-only | presolve |
none |
.method(HighsMethod) |
HiGHS-only | solver |
none |
.parallel(bool) |
HiGHS-only | parallel |
none |
HighsMethod variants: Choose (let HiGHS decide), Simplex, Ipm (interior-point), PdLp (first-order).
HighsPresolve variants: Off, On, Auto ("choose").
use Duration;
use ;
use UniversalOptionsExt;
let opts = default
.time_limit
.threads
.mip_gap
.presolve
.method
.parallel;
Result
SolverResult fields populated on Optimal or Feasible:
objective- objective value (adjusted for any constant term)primal- variable values, keyed byVarId; access viaresult.value_of(var)dual- constraint duals, keyed byConstraintIdreduced_costs- variable reduced costs, keyed byVarIdsolve_time- wall time measured around the HiGHS solve call
License
MIT OR Apache-2.0