cnvx
cnvx is a Rust library for modeling and solving optimization problems. It provides a clean and flexible API with an emphasis on clarity and performance.
Additionally, cnvx offers a command-line interface (CLI) for solving models directly from files in various formats, making it easy to experiment without writing Rust code.
Features
- Define decision variables with bounds, types (continuous, binary, integer), and custom constraints.
- Add linear or convex objectives with expressive operators.
- Modular API with prelude imports for ergonomic usage.
- Lightweight and extendable for integrating new solvers and algorithms.
- CLI support for solving optimization models from standard formats like GMPL, or MPS.
Cargo Features
cnvx can be customized using Cargo features:
lp– enable linear programming solvers (default)mop– enable multi-objective problem support (planned)sat– enable satisfiability problem support (planned)nlp– enable non-linear problem support (planned)
These features allow the use of specific solvers and functionalities while keeping the core library lightweight.
Installation
cnvx can be used either as a library in your Rust projects or via its command-line interface (CLI).
# Library usage
# CLI usage
Usage
The following example demonstrates how to define and solve a simple linear programming problem using cnvx:
use *;
License
Licensed under the MIT License. See the LICENSE file for more details.