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 through its features. In the current version, the parallel mode executes objective function evaluations in parallel (multi-threading) using the 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);
- [-] Modified Equilibrium optimizer (MEO);
- Growth Optimizer (GO);
- Gaining-Sharing Knowledge (GSK);
- [-] Gaining-Sharing Knowledge Based Algorithm With Adaptive Parameters (APGSK);
- [-] LSHADE_SPACMA(LSHADE_SPACMA)
Important
In the current version, binary and parallel optimization are implemented exclusively for the Equilibrium Optimizer (EO) and the Growth Optimizer (GO). Soon, these features will be available for the other algorithms as well.
Binary optimization
In the current version, binarization is performed using the S-Shape function provided below:
$S(x) = 1/(1 + e^{(-x)})$
In this context, x represents a "gene" and signifies each element in the candidate solution X ("genome") within a search space of length d, where $X= {x_1, x_2, ..., x_d}$.
The Binary optimization can be executed using the binary feature.
Example
- Import Sefar with binary feature in the Cargo.Toml file of your project.
[]
= { = "0.1.3", = ["binary"]}
- In the main.rs file :
extern crate sefar;
use EOA;
use OptimizationResult;
use ;
use Problem;
///
/// run the binary version of Growth Optimizer (Binary-GO).
///
// Define the objective function to minimize. Here, the Sphere function is implemented.
///
/// F1 : Sphere benchmark function.
/// Fi(X) = Sum(|X|)
/// where X = {x1, x2, ..... xd}, and 'd' is the problem dimension.
///
Supported features
Sefar supports report, binary and parallel features.
- Run report feature:
# run report feature:
;
# run binary feature:
;
# run parallel feature:
;
| Algorithm | report feature | binary feature | parallel feature |
|---|---|---|---|
| PSO | :heavy_check_mark: | ||
| EO | :heavy_check_mark: | :heavy_check_mark: S-Shape | :heavy_check_mark: |
| GO | :heavy_check_mark: | :heavy_check_mark: S-Shape | :heavy_check_mark: |
| GSK | :heavy_check_mark: | :heavy_check_mark: | |
| LSHADE_SPACMA |