Skip to content

Evolutionary Algorithms

Optimization algorithms inspired by biological evolution and natural selection.

Overview

Evolutionary algorithms use mechanisms inspired by biological evolution, such as reproduction, mutation, recombination, and selection. They maintain a population of candidate solutions and evolve them over generations.

Available Algorithms

Usage Example

python
from opt.evolutionary import GeneticAlgorithm, DifferentialEvolution
from opt.benchmark.functions import rastrigin

# Genetic Algorithm
ga = GeneticAlgorithm(
    func=rastrigin,
    lower_bound=-5.12,
    upper_bound=5.12,
    dim=10,
    max_iter=100,
    population_size=50
)
best_solution, best_fitness = ga.search()

See Also

Released under the MIT License.