https://github.com/fedemagnani/optimization-solvers
Composable numerical solvers for unconstrained and simple-bounds constrained convex optimization problems in Rust. WASM compatible
https://github.com/fedemagnani/optimization-solvers
bfgs convex-optimization lbfgs optimization optimization-algorithms optimization-methods rust solver spg
Last synced: about 2 months ago
JSON representation
Composable numerical solvers for unconstrained and simple-bounds constrained convex optimization problems in Rust. WASM compatible
- Host: GitHub
- URL: https://github.com/fedemagnani/optimization-solvers
- Owner: fedemagnani
- License: other
- Created: 2024-09-26T18:09:01.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-10T08:57:05.000Z (3 months ago)
- Last Synced: 2025-08-13T10:39:51.582Z (about 2 months ago)
- Topics: bfgs, convex-optimization, lbfgs, optimization, optimization-algorithms, optimization-methods, rust, solver, spg
- Language: Rust
- Homepage: https://fedemagnani.github.io/optimization-solvers-demo/
- Size: 9.98 MB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Optimization Solvers
A comprehensive Rust library implementing composable state-of-the-art numerical optimization algorithms with WebAssembly support for browser-based optimization.
- **[Live WASM demo](https://fedemagnani.github.io/optimization-solvers-demo/)** - Run some optimization problems from yout browser
## Quick Start
```rust
use optimization_solvers::{GradientDescent, BFGS, Newton};// Run optimization with any solver
let result = solver.minimize(objective_function, max_iterations);
```## 📚 Documentation & Resources
- **[Documentation](https://deepwiki.com/fedemagnani/optimization-solvers)** - Full Rust API documentation
- **[Examples](./examples/)** - Complete examples for all optimization algorithms
- **[WASM Documentation](./wasm/README.md)** - Browser-based optimization with WebAssembly
- **[Academic resources](./resources.md)** - Misc of papers/books about numerical optimization## 🧮 Solver Categories
### First-Order Methods
- **[Gradient Descent](./src/steepest_descent/gradient_descent.rs)** - Classic steepest descent
- **[Projected Gradient](./src/steepest_descent/projected_gradient_descent.rs)** - Constrained optimization
- **[Coordinate Descent](./src/steepest_descent/coordinate_descent.rs)** - Coordinate-wise optimization
- **[SPG](./src/steepest_descent/spg.rs)** - Spectral Projected Gradient
- **[P-Norm Descent](./src/steepest_descent/pnorm_descent.rs)** - Lp-norm based descent### Quasi-Newton Methods
- **[BFGS](./src/quasi_newton/bfgs.rs)** - Broyden-Fletcher-Goldfarb-Shanno
- **[DFP](./src/quasi_newton/dfp.rs)** - Davidon-Fletcher-Powell
- **[Broyden](./src/quasi_newton/broyden.rs)** - Broyden's method
- **[L-BFGS-B](./src/quasi_newton/lbfgsb.rs)** - Limited-memory BFGS with bounds (enable `lbfgsb` feature flag)### Second-Order Methods
- **[Newton's Method](./src/newton/mod.rs)** - Classical Newton optimization
- **[Projected Newton](./src/newton/projected_newton.rs)** - Constrained Newton
- **[SPN](./src/newton/spn.rs)** - Spectral Projected Newton## 🚀 Getting Started
```bash
# Add to Cargo.toml
cargo add optimization-solvers# Run examples
cargo run --example gradient_descent_example
cargo run --example bfgs_example# Build for WebAssembly
cd wasm && ./build-wasm.sh
```## 📦 Features
- **Multiple Algorithms**: 15+ optimization algorithms
- **WebAssembly Support**: Run in browsers with full performance
- **Line Search Methods**: Backtracking, More-Thuente, and more
- **Bounded Optimization**: Support for box constraints
- **Comprehensive Examples**: Ready-to-run examples for all solvers