DSMGA2
A genetic algorithm that learns problem structure. 75-91% fewer evaluations than standard GAs on hard problems.
Installation
Quick Start
# Built-in problem
=
=
# Custom problem (NumPy compatible)
return
return
=
=
Why DSMGA2?
DSMGA2 automatically discovers which variables interact, allowing it to solve problems more efficiently than standard genetic algorithms.
Benchmark: MAX-SAT (NP-complete problem)

| Problem Size | DSMGA2 | PyGAD | DEAP |
|---|---|---|---|
| 20 variables | 17K | 202K | 201K |
| 30 variables | 127K | 500K | 500K |
| 40 variables | 50K | 459K | 500K |
Values = function evaluations to solution (lower is better)
This compares DSMGA2 against popular Python GA libraries. For academic comparisons with linkage-learning algorithms (LT-GOMEA, hBOA), see the original paper.
Rust Usage
use ;
let mut ga = new
.population_size
.build;
ga.run;
println!;
License
MIT OR Apache-2.0