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
- Genetic Algorithm - Classic evolutionary algorithm
- Differential Evolution - Vector-based evolutionary strategy
- CMA-ES - Covariance Matrix Adaptation Evolution Strategy
- Cultural Algorithm - Dual inheritance system
- Imperialist Competitive Algorithm - Socio-politically inspired
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
- API Reference - Complete API documentation
- Swarm Intelligence - Related population-based methods