Sefar
Sefar is a simple and comprehensive Rust library for evolutionary optimization algorithms, exclusively written using Rust safe code. It supports continuous and binary optimization in both sequential and parallel modes. In the current version, the parallel mode executes objective function evaluations in parallel (multi-threading) using rayon crate.
Current state (Under development)
-
Sefar perfoms minimization by default. In the case of maximization, the objective function $f(X)$ can be expressed as $-f(X)$.
-
In this version, Sefar supports:
- Particle Swarm Optimization (PSO);
- Equilibrium optimizer (EO);
- Improved Equilibrium optimizer (IEO);
- Binary Equilibrium Optimizer (BiEO);
- [-] Modified Equilibrium optimizer (MEO);
- Growth Optimizer (GO);
- Gaining-Sharing Knowledge (GSK);
- [-] Gaining-Sharing Knowledge Based Algorithm With Adaptive Parameters (APGSK);
- [-] LSHADE_SPACMA(LSHADE_SPACMA)
Binary optimization
The binary optimizatin in the older versions of Sefar will be replaced by more efficent binary optimization algorithms.* This approach aims to simplify the implementation of algorithms on one hand and to offer parallel mode for binary algorithms as well in simple way.
Parallel optimization
In the current version of Sefar, only the objective function evaluation is run in parallel mode using rayon crate.
Example
- Import Sefar in the Cargo.Toml file of your project.
[]
= "0.2.0"
- In the main.rs file :
extern crate sefar;
use EOA;
use OptimizationResult;
use ;
use Problem;
// Define the objective function to minimize. Here, the Sphere function is implemented.
///
/// F1 : Sphere benchmark function.
/// Fi(X) = Sum(|X^2|)
/// where X = {x1, x2, ..... xd}, and 'd' is the problem dimension.
///
Supported features
Sefar supports report and parallel features.
- Run report feature:
# run report feature:
;
# run parallel feature:
;
| Algorithm | report feature | parallel feature |
|---|---|---|
| PSO | [x] | |
| EO | [x] | [x] |
| GO | [x] | [x] |
| GSK | [x] | [x] |
| LSHADE_SPACMA | ||
| BiEO | [x] | |
| IEO | [x] | [x] |