All Projects → king-11 → genx

king-11 / genx

Licence: MIT license
Genx provides modular building blocks to run simulations of optimization and search problems using Genetic Algorithms

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to genx

Argmin
Mathematical optimization in pure Rust
Stars: ✭ 234 (+654.84%)
Mutual labels:  optimization
Lbfgspp
A header-only C++ library for L-BFGS and L-BFGS-B algorithms
Stars: ✭ 245 (+690.32%)
Mutual labels:  optimization
password-ga
Password Generator using Genetic Algorithm
Stars: ✭ 28 (-9.68%)
Mutual labels:  genetic
Learningx
Deep & Classical Reinforcement Learning + Machine Learning Examples in Python
Stars: ✭ 241 (+677.42%)
Mutual labels:  optimization
Minisam
A general and flexible factor graph non-linear least square optimization framework
Stars: ✭ 246 (+693.55%)
Mutual labels:  optimization
Superstring
A fast and memory-optimized string library for C++
Stars: ✭ 252 (+712.9%)
Mutual labels:  optimization
Functional intro to python
[tutorial]A functional, Data Science focused introduction to Python
Stars: ✭ 228 (+635.48%)
Mutual labels:  optimization
LaplacianOpt.jl
A Julia/JuMP Package for Maximizing Algebraic Connectivity of Undirected Weighted Graphs
Stars: ✭ 16 (-48.39%)
Mutual labels:  optimization
Bayesian Optimization
Python code for bayesian optimization using Gaussian processes
Stars: ✭ 245 (+690.32%)
Mutual labels:  optimization
ga-for-cvrp
Capacitated Vehicle Routing Problem
Stars: ✭ 56 (+80.65%)
Mutual labels:  genetic
Unitysizeexplorer
Visualize how much space each asset in your Unity game takes and quickly optimize your game's file size
Stars: ✭ 242 (+680.65%)
Mutual labels:  optimization
Aqo
Adaptive query optimization for PostgreSQL
Stars: ✭ 243 (+683.87%)
Mutual labels:  optimization
Ray
An open source framework that provides a simple, universal API for building distributed applications. Ray is packaged with RLlib, a scalable reinforcement learning library, and Tune, a scalable hyperparameter tuning library.
Stars: ✭ 18,547 (+59729.03%)
Mutual labels:  optimization
Jmetalpy
A framework for single/multi-objective optimization with metaheuristics
Stars: ✭ 236 (+661.29%)
Mutual labels:  optimization
TSP-GA
Traveling Salesman Problem Using Parallel Genetic Algorithms
Stars: ✭ 29 (-6.45%)
Mutual labels:  genetic
Superstring.py
A fast and memory-optimized string library for heavy-text manipulation in Python
Stars: ✭ 231 (+645.16%)
Mutual labels:  optimization
Yalmip
MATLAB toolbox for optimization modeling
Stars: ✭ 251 (+709.68%)
Mutual labels:  optimization
Optimization
A set of lightweight header-only template functions implementing commonly-used optimization methods on Riemannian manifolds and convex spaces.
Stars: ✭ 66 (+112.9%)
Mutual labels:  optimization
variantkey
Numerical Encoding for Human Genetic Variants
Stars: ✭ 32 (+3.23%)
Mutual labels:  genetic
Koi
Koi Farm, a koi breeding game
Stars: ✭ 343 (+1006.45%)
Mutual labels:  genetic

genx

crb dcb build size downloads license

genx provides modular building blocks to run simulations of optimization and search problems using Genetic Algorithms (GA).

The vision for genx is to be a flexible and greatly extensible library for implementing genetic algorithm applications. genx is written in Rust. The library's API utilizes functional programming paradigm and exposes it's API in that manner only.

The implementation is split into building blocks which are all represented by traits. This crate provides most common and probably all possible implementation for all building blocks. So it can be used for many problems out of the box.

Documentation

Basic Example

Selection

Here's a trivial example that returns back individual selected using stochastic universal sampling

use genx::selection::stochastic_universal::stochastic_universal_selection;

let num_parents:usize = 10;
let fitness_values = vec![2.4,8.4,3.2,9.4,9.0,11.0,4.5,0.6,4.4,2.3,5.6,10.0,0.2,9.0,4.8,7.7];

let result = stochastic_universal_selection(&fitness_values, num_parents, None)
                .iter()
                .map(|&a| fitness_values[a])
                .collect::<Vec<f32>>();

stochastic_universal_selection takes in the fitness_value vector, number of parents it needs to select and a seed value which is Option<u64>. It returns back the indices of selected individuals which we map to actual fitness values.

Mutation

Mutation function takes in a single individual, distribution index and returns in the mutated individual using polynomial mutation for real valued individual.

use genx::mutation::polynomial::polynomial_mutation;
let individual = 29.11;
let result = polynomial_mutation(individual, 4.2, 4.0, None);

The returned value may or may not be equal as is mutated based on a randomly generated value, which for deterministic results can be seeded.

Building Blocks

The genetic algorithm needs a population that it evolves with each iteration. A population contains a number of individuals. Each individual represents a possible candidate solution for an optimization problem for which the best solution is searched for.

A Genetic Algorithm proceeds through following operations:

  • Encoding: Binary, Real Values, Order, Tree, etc.
  • Selection: Selecting individuals after fitness evaluation.
  • Crossover: Creating new individuals from selected pool of individuals.
  • Mutation: Making stark changes in generated individual for diversification.
  • Convergence: Test for goal accomplishment or convergence.

The building blocks currently available (defined as traits) are:

  • Selection
  • Mutation

This crate provides multiple implementations for each one of those operators. So one can experiment with combining the different implementations to compose the best algorithm for a specific search or optimization problem.

Usage

Add this to your Cargo.toml:

[dependencies]
genx = "0.4.0"

If you are not using Rust 2018 edition add this to your crate root:

extern crate genx;

Why Genetic Algorithms

Genetic Algorithms are at the core of soft computing which is a branch of computing that comes to rescue when problem at hand is not feasible to be solved using hard computing. There are several advantages of genetic algorithms:

  • Algorithms are adaptive and can adjust to the change of dynamic environment​
  • The approach makes use of approximate solutions to solve problems that may be either unsolvable or too time-consuming to solve with current hardware.​
  • Imprecise but usable solutions to complex computational problems allowing researchers to approach some problems that traditional computing cannot process.​

Inspiration

I started this project mainly to learn about genetic algorithms (GAs) as part of my college curriculum where am studying severals methods for soft computing. I found myself looking for simple easy to use modular functions that I can use to learn more about each step of GA.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].