Skip to main content

Module compact_genetic

Module compact_genetic 

Source
Expand description

Compact Genetic Algorithm (cGA) model for binary search spaces.

cGA represents a virtual binary population as a per-gene probability vector and emulates a steady-state GA of size virtual_pop_size without storing the population explicitly. fit competes the winner (best fitness) against the loser (worst fitness) of the truncation-selected subset: on every gene where they disagree the probability is nudged by ±1 / virtual_pop_size toward the winner’s bit. sample emits raw {0, 1} f32 genes; EdaParams::bounds clamps are therefore no-ops.

§Deviation from classic cGA

The textbook cGA (Harik et al., 1999) draws two individuals uniformly at random from the whole population and competes them. Here the winner and loser are the best and worst of the truncation-selected subset handed to fit by EdaStrategy, so the update is biased by the selection pressure already applied upstream.

§References

  • Harik, Lobo & Goldberg (1999), The compact genetic algorithm.

Structs§

CompactGenetic
Compact Genetic Algorithm for binary spaces (cGA).
CompactGeneticParams
Per-run configuration for the CompactGenetic model.
CompactGeneticState
Fitted state for the CompactGenetic model after one call to ProbabilityModel::fit.