oximo is solver-agnostic, and provides a variety of backends to solve your optimization models.
Every backend implements the same Solver trait, so swapping engines is a one-line change. The general pattern is:
let result = Backend.solve(&model, &BackendOptions::default())?;
result is a SolverResult, the same struct regardless of backend.
πChoosing a backend
To determine what backend to use, consider what each backend solves (by model kind) and what it costs and offers (license, install, diagnostics). Each backend's Cargo feature flag is named in its own section below.
πModel kind support
Each row is what Solver::supports accepts for that backend, against every ModelKind:
| Backend | LP | MILP | QP | MIQP | QCP | MIQCP | SOCP | MISOCP | NLP | MINLP |
|---|---|---|---|---|---|---|---|---|---|---|
Highs | β | β | β | β | β | β | β | β | β | β |
Clarabel | β | β | β | β | β | β | β | β | β | β |
Pounce | β | β | β | β | β | β | β | β | β | β |
Gurobi | β | β | β | β | β | β | β | β | β | β |
Mosek | β | β | β | β | β | β | β | β | β | β |
Baron | β | β | β | β | β | β | β | β | β | β |
Gams | β | β | β | β | β | β | β | β | β | β |
Gams accepts every kind at the oximo layer, but the actual coverage is the GAMS sub-solver's. Pick one that handles the kind you emit.
πRequirements & capabilities
Deployment cost and diagnostic/solve capability per backend.
β = yes/supported; β = no.
| Backend | License | Separate install | C compiler | Direct interface | IIS | Warm start | Sol. pool | Duals | Parallel |
|---|---|---|---|---|---|---|---|---|---|
Highs | β | β | β | β | ββ | β | β | β | β |
Clarabel | β | β | β | β | β | β | β | β | β |
Pounce | β | β | β | β | β | β | β | β | β |
Gurobi | β | β | β | β | β | β | β | β | β |
Mosek | β | β | β | β | β | β | β | β | β |
Baron | β | β | β | β | β | β | β | β | β |
Gams | β | β | β | β | β | β | βΒΆ | β | β |
Column meanings:
- License: the underlying solver is commercial and needs a license at runtime. The oximo wrapper crates are all MIT OR Apache-2.0.
- Direct interface: talks to the solver in-process. C API/FFI for HiGHS, Gurobi, and MOSEK. Pure Rust for Clarabel and Pounce. BARON and GAMS instead exchange model/result files (
.bar,.gms) with an external executable. - C compiler: whether a C/C++ compiler is required at build time.
- IIS: computes an irreducible infeasible set to explain an infeasible model.
- Warm start: persistent handle for incremental re-solves.
- Sol. pool: returns multiple solutions, best-first.
- Duals: shadow prices/reduced costs.
- Parallel: solver can solve in parallel.
Footnotes:
- β The
highscrate does not support IIS yet. - ΒΆ GAMS's pool and duals come from the underlying sub-solver's GDX output (e.g. CPLEX
solnpool).
A backend rejects model kinds it can't handle, so check Model::kind() if a solve returns SolverError::UnsupportedKind.
πExternal solver setup
Gurobi, MOSEK, BARON, and GAMS need software installed outside Cargo. Add the corresponding feature only after that software is installed and licensed.
πGurobi
Enable gurobi, set GUROBI_HOME to the Gurobi installation, and make sure a
Gurobi license is active. The backend links through the
grb crate.
[dependencies]
oximo = { version = "0.5", features = ["gurobi"] }πMOSEK
Enable mosek, install MOSEK 11.2, and configure a valid license. Set
MOSEK_BINDIR_112 to MOSEK's platform bin directory when the installation is
not in its default location. The backend links through the
mosek crate.
Note for Windows: the current
mosekcrate build script emits an unquoted linker flag, so settingMOSEK_BINDIR_112directly to a path containing spaces can fail. Create a junction with a space-free path, then point the environment variable at that junction. See mosek.rust#1.
Note: We currently support only MOSEK 11.2. Support for other versions of MOSEK is planned.
[dependencies]
oximo = { version = "0.5", features = ["mosek"] }πBARON and GAMS
Enable baron or gams after placing the respective executable on PATH.
Both backends exchange files with an external program rather than linking the
solver into your process.
[dependencies]
oximo = { version = "0.5", features = ["baron"] }
Use features = ["gams"] instead for GAMS.
πHiGHS
Highs is bundled by default via the highs Cargo feature. No external install required, but a C/C++ compiler is needed at build time.
use oximo::prelude::*;
use oximo::solvers::Highs;
use std::time::Duration;
let result = Highs.solve(&m, &HighsOptions::default()
.time_limit(Duration::from_secs(60))
.threads(4)
.mip_gap(0.01)
.verbose(true)
.method(HighsMethod::Ipm))?;
Common HighsOptions:
| Method | Effect |
|---|---|
.time_limit(d) | Stop after d (std::time::Duration) |
.threads(n) | Cap parallelism |
.mip_gap(g) | Relative MIP optimality gap (e.g. 0.01 = 1%) |
.verbose(b) | Stream the solver log |
.method(m) | LP algorithm via HighsMethod (Simplex, Ipm, β¦) |
πClarabel
Clarabel is a pure-Rust conic interior-point solver. No install, no license. It handles continuous LP, QP (convex quadratic objectives), and SOCP models.
use oximo::prelude::*;
use oximo::solvers::Clarabel;
let result = Clarabel.solve(&m, &ClarabelOptions::default())?;πPOUNCE
Pounce is a pure-Rust port of IPOPT, covering continuous LP/QP/QCP/NLP. Enable the pounce feature.
use oximo::prelude::*;
use oximo::pounce::Pounce;
let result = Pounce.solve(&m, &PounceOptions::default())?;
Purely linear/quadratic models solve with exact analytic derivatives. Models containing a nonlinear function fall back to finite differences and an L-BFGS Hessian unless you enable the nightly-only pounce-enzyme feature, which supplies exact gradients plus sparse Jacobians and Hessians.
For any nonlinear model, enabling pounce-enzyme is highly recommended. Exact derivatives are faster and far more accurate than the finite-difference fallback, which improves both convergence and robustness. It requires a nightly toolchain and a fat-LTO build (see Installation > Advanced: exact nonlinear derivatives).
πGurobi
Gurobi requires the gurobi Cargo feature plus a licensed Gurobi installation reachable via GUROBI_HOME.
Note: Only Gurobi v12 and later are supported.
use oximo::prelude::*;
use oximo::solvers::Gurobi;
use std::time::Duration;
let result = Gurobi.solve(&m, &GurobiOptions::default()
.time_limit(Duration::from_secs(120))
.mip_focus(1)
.seed(101))?;
Common GurobiOptions:
| Method | Effect |
|---|---|
.time_limit(d) | Wall-clock limit |
.mip_focus(n) | Gurobi MIPFocus (1 = feasibility, 2 = optimality, 3 = bound) |
.mip_gap(g) | Relative MIP optimality gap |
.seed(n) | Random seed for reproducible runs |
πMOSEK
Mosek supports LP, MILP, convex QP/MIQP, convex QCP/MIQCP, and
SOCP/MISOCP models. It requires the mosek Cargo feature, a licensed MOSEK
11.2 installation, and MOSEK_BINDIR_112 when MOSEK is outside its default
location. MOSEK validates the convexity of quadratic data.
use oximo::prelude::*;
use oximo::solvers::Mosek;
use std::time::Duration;
let result = Mosek.solve(&m, &MosekOptions::default()
.time_limit(Duration::from_secs(120))
.threads(4)
.mio_tol_rel_gap(1e-4))?;
MosekOptions provides builders for every MOSEK 11.2 parameter. Universal
options such as time_limit, threads, and verbose are applied first.
MOSEK-specific parameter builders are then applied in call order.
πBARON
Baron is a global solver for nonconvex LP/MILP/QP/MIQP/NLP/MINLP. Requires the baron feature and a licensed BARON install on PATH.
use oximo::prelude::*;
use oximo::solvers::Baron;
let result = Baron::new().solve(&m, &BaronOptions::default())?;πGAMS
Gams requires the gams Cargo feature plus a GAMS install on PATH. Useful when you want to route a model through GAMS-managed solvers (CPLEX, BARON, IPOPT, KNITRO, ...).
use oximo::prelude::*;
use oximo::solvers::Gams;
let result = Gams.solve(&m, &GamsOptions::default())?;
See GamsOptions and the per-solver option structs in oximo::gams (GamsCplexOptions, GamsBaronOptions, GamsIpoptOptions, ...) for tuning the underlying solver.
πNext steps
- Results: inspect solver status, values, duals, and solution pools
- Printing & Debugging: print a model as algebra and track down what it actually says
- I/O: write your model to MPS, LP or NL for use with external tools