2 releases (1 stable)

1.0.0 Dec 30, 2024
0.1.0 Dec 30, 2024

#1238 in Algorithms

Download history 115/week @ 2024-12-24 129/week @ 2024-12-31 2/week @ 2025-01-07

246 downloads per month

Unlicense

38KB
144 lines

Galapagos

Crates.io Docs.rs License: Unlicensed

Simple evolutionary solver written in Rust.

Graph of fitness over time

Usage

use matrix_rs::galapagos::{self, Goal};

fn main() {
    let solution = galapagos::solve(
        |xs| {
            // Rosenbrock: (a - x)^2 + b(y - x^2)^2
            let x = xs[0];
            let y = xs[1];
            (1.0 - x).powi(2) + 100.0 * (y - x.powi(2)).powi(2)
        },
        &[(-5.0, 5.0), (-5.0, 5.0)],
        Goal::Minimize,
        Default::default(),
    );
    println!("{solution:?}");
}

lib.rs:

Galapagos

Low-dependency, simple evolutionary solver.

Dependencies

~315KB