Skip to content

Latest commit

 

History

History

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Examples

Each example is a folder with the same program in Rust (main.rs) and Python (main.py), and a README.md that describes the problem, cites its source and gives the known optimum. The README's YAML front matter (title, category, summary, reference, reference_url, optimum, languages, order) is what the docs site builds its example pages from. CI runs every example in both languages. The problems of one paper (ZDT, DTLZ, WFG, CEC 2006...) share an optional family, all in one category: the project page shows them as tabs of one another, labelled by the optional tab (the title when absent), and the docs site's navigation in a section of their own.

Both versions use the same algorithm, settings and seed, and print the same output. The exception is a fitness function in numpy with functions such as cosine, whose last bit can differ from Rust's: the runs then drift apart. The test problems of genoxide.problems are evaluated in Rust in both languages, with genoxide's portable math, so their runs don't, on any platform.

Run a Rust example from the root of the repository:

cargo run --release --example tsp_berlin52

and a Python one after pip install genoxide:

python examples/tsp_berlin52/main.py
Example Category Languages Interactive run
OneMax binary Rust, Python tachsin.gr
LeadingOnes binary Rust, Python tachsin.gr
Deceptive trap binary Rust, Python tachsin.gr
Royal road R1 binary Rust, Python tachsin.gr
Royal road R2 binary Rust, Python tachsin.gr
NK landscape binary Rust, Python tachsin.gr
0/1 knapsack constrained Rust, Python tachsin.gr
N-Queens 8×8 permutation Rust, Python tachsin.gr
N-Queens 16×16 permutation Rust, Python tachsin.gr
N-Queens 32×32 permutation Rust, Python tachsin.gr
N-Queens 64×64 permutation Rust, Python tachsin.gr
N-Queens 128×128 permutation Rust, Python tachsin.gr
Travelling salesman (berlin52) permutation Rust, Python tachsin.gr
Job shop scheduling (ft06) permutation Rust, Python tachsin.gr
Sphere continuous Rust, Python tachsin.gr
Axis-parallel ellipsoid continuous Rust, Python tachsin.gr
Schwefel 1.2 continuous Rust, Python tachsin.gr
Schwefel 2.21 continuous Rust, Python tachsin.gr
Schwefel 2.22 continuous Rust, Python tachsin.gr
Zakharov continuous Rust, Python tachsin.gr
Trid continuous Rust, Python tachsin.gr
Dixon-Price continuous Rust, Python tachsin.gr
Powell continuous Rust, Python tachsin.gr
Sum of different powers continuous Rust, Python tachsin.gr
Step continuous Rust, Python tachsin.gr
Quartic continuous Rust, Python tachsin.gr
Rotated hyper-ellipsoid continuous Rust, Python tachsin.gr
High-conditioned elliptic continuous Rust, Python tachsin.gr
Bent cigar continuous Rust, Python tachsin.gr
Discus continuous Rust, Python tachsin.gr
Different powers continuous Rust, Python tachsin.gr
Rosenbrock continuous Rust, Python tachsin.gr
Levy continuous Rust, Python tachsin.gr
Styblinski-Tang continuous Rust, Python tachsin.gr
Michalewicz continuous Rust, Python tachsin.gr
Ackley continuous Rust, Python tachsin.gr
Rastrigin function continuous Rust, Python tachsin.gr
Griewank continuous Rust, Python tachsin.gr
Schwefel 2.26 continuous Rust, Python tachsin.gr
Himmelblau's function continuous Rust, Python tachsin.gr
Branin continuous Rust, Python tachsin.gr
Goldstein-Price continuous Rust, Python tachsin.gr
Six-hump camel continuous Rust, Python tachsin.gr
Three-hump camel continuous Rust, Python tachsin.gr
Beale continuous Rust, Python tachsin.gr
Booth continuous Rust, Python tachsin.gr
Matyas continuous Rust, Python tachsin.gr
Bohachevsky 1 continuous Rust, Python tachsin.gr
Bohachevsky 2 continuous Rust, Python tachsin.gr
Bohachevsky 3 continuous Rust, Python tachsin.gr
Hartmann 3-D continuous Rust, Python tachsin.gr
Hartmann 6-D continuous Rust, Python tachsin.gr
Shekel 5 continuous Rust, Python tachsin.gr
Shekel 7 continuous Rust, Python tachsin.gr
Shekel 10 continuous Rust, Python tachsin.gr
Shekel's foxholes continuous Rust, Python tachsin.gr
Langermann continuous Rust, Python tachsin.gr
Kowalik continuous Rust, Python tachsin.gr
Easom continuous Rust, Python tachsin.gr
Eggholder continuous Rust, Python tachsin.gr
Schaffer F6 continuous Rust, Python tachsin.gr
Schaffer F7 continuous Rust, Python tachsin.gr
Penalized 1 continuous Rust, Python tachsin.gr
Penalized 2 continuous Rust, Python tachsin.gr
Büche-Rastrigin continuous Rust, Python tachsin.gr
Non-continuous Rastrigin continuous Rust, Python tachsin.gr
Weierstrass continuous Rust, Python tachsin.gr
Katsuura continuous Rust, Python tachsin.gr
HappyCat continuous Rust, Python tachsin.gr
HGBat continuous Rust, Python tachsin.gr
Pressure vessel design constrained Rust, Python tachsin.gr
Welded beam design constrained Rust, Python tachsin.gr
Tension/compression spring constrained Rust, Python tachsin.gr
Speed reducer constrained Rust, Python tachsin.gr
Three-bar truss constrained Rust, Python tachsin.gr
Cantilever beam constrained Rust, Python tachsin.gr
Car side impact constrained Rust, Python tachsin.gr
CEC 2006 g01 constrained Rust, Python tachsin.gr
CEC 2006 g02 constrained Rust, Python tachsin.gr
CEC 2006 g03 constrained Rust, Python tachsin.gr
CEC 2006 g04 constrained Rust, Python tachsin.gr
CEC 2006 g05 constrained Rust, Python tachsin.gr
CEC 2006 g06 constrained Rust, Python tachsin.gr
CEC 2006 g07 constrained Rust, Python tachsin.gr
CEC 2006 g08 constrained Rust, Python tachsin.gr
CEC 2006 g09 constrained Rust, Python tachsin.gr
CEC 2006 g10 constrained Rust, Python tachsin.gr
CEC 2006 g11 constrained Rust, Python tachsin.gr
CEC 2006 g12 constrained Rust, Python tachsin.gr
CEC 2006 g13 constrained Rust, Python tachsin.gr
CEC 2006 g14 constrained Rust, Python tachsin.gr
CEC 2006 g15 constrained Rust, Python tachsin.gr
CEC 2006 g16 constrained Rust, Python tachsin.gr
CEC 2006 g17 constrained Rust, Python tachsin.gr
CEC 2006 g18 constrained Rust, Python tachsin.gr
CEC 2006 g19 constrained Rust, Python tachsin.gr
CEC 2006 g20 constrained Rust, Python tachsin.gr
CEC 2006 g21 constrained Rust, Python tachsin.gr
CEC 2006 g22 constrained Rust, Python tachsin.gr
CEC 2006 g23 constrained Rust, Python tachsin.gr
CEC 2006 g24 constrained Rust, Python tachsin.gr
Gear train design integer Rust, Python tachsin.gr
ZDT1 multi-objective Rust, Python tachsin.gr
ZDT2 multi-objective Rust, Python tachsin.gr
ZDT3 multi-objective Rust, Python tachsin.gr
ZDT4 multi-objective Rust, Python tachsin.gr
ZDT5 multi-objective Rust, Python tachsin.gr
ZDT6 multi-objective Rust, Python tachsin.gr
Schaffer 1 multi-objective Rust, Python tachsin.gr
Schaffer 2 multi-objective Rust, Python tachsin.gr
Fonseca-Fleming multi-objective Rust, Python tachsin.gr
Kursawe's disconnected front multi-objective Rust, Python tachsin.gr
Poloni multi-objective Rust, Python tachsin.gr
BNH, a constrained two-objective problem multi-objective Rust, Python tachsin.gr
SRN (Srinivas and Deb) multi-objective Rust, Python tachsin.gr
TNK (Tanaka) multi-objective Rust, Python tachsin.gr
OSY (Osyczka and Kundu) multi-objective Rust, Python tachsin.gr
CONSTR multi-objective Rust, Python tachsin.gr
WFG1 multi-objective Rust, Python tachsin.gr
WFG2 multi-objective Rust, Python tachsin.gr
WFG3 multi-objective Rust, Python tachsin.gr
WFG4 multi-objective Rust, Python tachsin.gr
WFG5 multi-objective Rust, Python tachsin.gr
WFG6 multi-objective Rust, Python tachsin.gr
WFG7 multi-objective Rust, Python tachsin.gr
WFG8 multi-objective Rust, Python tachsin.gr
WFG9 multi-objective Rust, Python tachsin.gr
DTLZ1 with 3 objectives multi-objective Rust, Python tachsin.gr
DTLZ2 with 3 objectives multi-objective Rust, Python tachsin.gr
DTLZ3 with 3 objectives multi-objective Rust, Python tachsin.gr
DTLZ4 with 3 objectives multi-objective Rust, Python tachsin.gr
DTLZ5 with 3 objectives multi-objective Rust, Python tachsin.gr
DTLZ6 with 3 objectives multi-objective Rust, Python tachsin.gr
DTLZ7 with 3 objectives multi-objective Rust, Python tachsin.gr
Viennet 1 multi-objective Rust, Python tachsin.gr
Viennet 2 multi-objective Rust, Python tachsin.gr
Viennet 3 multi-objective Rust, Python tachsin.gr
CTP1 multi-objective Rust, Python tachsin.gr
CTP2 multi-objective Rust, Python tachsin.gr
CTP3 multi-objective Rust, Python tachsin.gr
CTP4 multi-objective Rust, Python tachsin.gr
CTP5 multi-objective Rust, Python tachsin.gr
CTP6 multi-objective Rust, Python tachsin.gr
CTP7 multi-objective Rust, Python tachsin.gr
CTP8 multi-objective Rust, Python tachsin.gr
C1-DTLZ1 with 3 objectives multi-objective Rust, Python tachsin.gr
C1-DTLZ3 with 3 objectives multi-objective Rust, Python tachsin.gr
C2-DTLZ2 with 3 objectives multi-objective Rust, Python tachsin.gr
Convex C2-DTLZ2 with 3 objectives multi-objective Rust, Python tachsin.gr
C3-DTLZ1 with 3 objectives multi-objective Rust, Python tachsin.gr
C3-DTLZ4 with 3 objectives multi-objective Rust, Python tachsin.gr
DTLZ8 with 3 objectives multi-objective Rust, Python tachsin.gr
DTLZ9 with 3 objectives multi-objective Rust, Python tachsin.gr
DC1-DTLZ1 with 3 objectives multi-objective Rust, Python tachsin.gr
DC1-DTLZ3 with 3 objectives multi-objective Rust, Python tachsin.gr
DC2-DTLZ1 with 3 objectives multi-objective Rust, Python tachsin.gr
DC2-DTLZ3 with 3 objectives multi-objective Rust, Python tachsin.gr
DC3-DTLZ1 with 3 objectives multi-objective Rust, Python tachsin.gr
DC3-DTLZ3 with 3 objectives multi-objective Rust, Python tachsin.gr
DAS-CMOP1 multi-objective Rust, Python tachsin.gr
DAS-CMOP2 multi-objective Rust, Python tachsin.gr
DAS-CMOP3 multi-objective Rust, Python tachsin.gr
DAS-CMOP4 multi-objective Rust, Python tachsin.gr
DAS-CMOP5 multi-objective Rust, Python tachsin.gr
DAS-CMOP6 multi-objective Rust, Python tachsin.gr
DAS-CMOP7 multi-objective Rust, Python tachsin.gr
DAS-CMOP8 multi-objective Rust, Python tachsin.gr
DAS-CMOP9 multi-objective Rust, Python tachsin.gr
Convex DTLZ2 with 3 objectives multi-objective Rust, Python tachsin.gr
Scaled DTLZ1 with 3 objectives multi-objective Rust, Python tachsin.gr
Scaled DTLZ2 with 3 objectives multi-objective Rust, Python tachsin.gr
Inverted DTLZ1 with 3 objectives multi-objective Rust, Python tachsin.gr
MW1 multi-objective Rust, Python tachsin.gr
MW2 multi-objective Rust, Python tachsin.gr
MW3 multi-objective Rust, Python tachsin.gr
MW4 multi-objective Rust, Python tachsin.gr
MW5 multi-objective Rust, Python tachsin.gr
MW6 multi-objective Rust, Python tachsin.gr
MW7 multi-objective Rust, Python tachsin.gr
MW8 multi-objective Rust, Python tachsin.gr
MW9 multi-objective Rust, Python tachsin.gr
MW10 multi-objective Rust, Python tachsin.gr
MW11 multi-objective Rust, Python tachsin.gr
MW12 multi-objective Rust, Python tachsin.gr
MW13 multi-objective Rust, Python tachsin.gr
MW14 multi-objective Rust, Python tachsin.gr
Two-bar truss multi-objective Rust, Python tachsin.gr
Welded beam, two objectives multi-objective Rust, Python tachsin.gr
Disc brake multi-objective Rust, Python tachsin.gr
Speed reducer, two objectives multi-objective Rust, Python tachsin.gr
Four-bar truss multi-objective Rust, Python tachsin.gr
Car side impact, three objectives multi-objective Rust, Python tachsin.gr
Rocket injector multi-objective Rust, Python tachsin.gr
Vehicle crashworthiness multi-objective Rust, Python tachsin.gr
Water resource planning multi-objective Rust, Python tachsin.gr
Conceptual marine design multi-objective Rust, Python tachsin.gr
XOR neuroevolution neuroevolution Rust, Python tachsin.gr
XOR by NEAT neuroevolution Rust, Python tachsin.gr
Cart-pole neuroevolution Rust, Python tachsin.gr
Double pole balancing neuroevolution Rust, Python tachsin.gr
Double pole balancing without velocities neuroevolution Rust, Python tachsin.gr
Two spirals neuroevolution Rust, Python tachsin.gr
Koza's quartic genetic programming Rust, Python tachsin.gr
Koza's 11-multiplexer genetic programming Rust, Python tachsin.gr
|x| by strongly typed GP genetic programming Rust, Python tachsin.gr
Nguyen-1 genetic programming Rust, Python tachsin.gr
Nguyen-5 genetic programming Rust, Python tachsin.gr
Nguyen-9 genetic programming Rust, Python tachsin.gr
Nguyen-1 to 12 genetic programming Rust, Python
Accuracy against size genetic programming Rust, Python tachsin.gr
Asynchronous evaluation engine Rust tachsin.gr
Neuroevolution on the GPU engine Rust tachsin.gr
Nelder-Mead on Rosenbrock local Rust, Python tachsin.gr
Nelder-Mead with restarts on Himmelblau local Rust, Python tachsin.gr
L-BFGS-B on Rosenbrock in 100 dimensions local Rust, Python tachsin.gr
L-BFGS-B on a minimum at the bound local Rust, Python tachsin.gr
SHADE, then L-BFGS-B local Rust, Python tachsin.gr
Adam with a learning-rate schedule local Rust, Python tachsin.gr
MMA on a million variables local Rust, Python tachsin.gr
Continuation by Gaussian smoothing local Rust, Python tachsin.gr
Bayesian optimization of Branin bayesian Rust, Python tachsin.gr
Bayesian optimization in batches on Hartmann 6-D bayesian Rust, Python tachsin.gr
Asynchronous Bayesian optimization bayesian Rust tachsin.gr
Constrained Bayesian optimization bayesian Rust, Python tachsin.gr

The GPU example is a crate of its own, with wgpu as a dependency: cargo run --release --manifest-path examples/gpu/Cargo.toml.

Adding an example

Add a folder examples/<name>/ with main.rs, main.py (unless the Python package lacks a feature it needs, which its README says) and a README.md with the front matter, and a row to the table above. Cargo finds main.rs as the example <name>, CI runs every main.rs and main.py, and the docs site makes a page for it, whose build fails if the table lacks the example. The categories are binary, permutation, integer, continuous, multi-objective, constrained, neuroevolution, genetic programming, engine, local and bayesian.