feat(algorithms): add NSGA-II

Standard (μ+λ) NSGA-II with binary tournament parent selection on
(rank, crowding distance) and elitist survival selection on the combined
parent + offspring population (spec §12.3):

1. Initialize population_size random decisions.
2. Each generation: select parents by binary tournament (rank ↑ then
   crowding ↓ then random), apply variation, evaluate offspring,
   combine, non_dominated_sort, fill the next population front-by-front
   trimming the partial last front by crowding distance descending.
3. Return final population, Pareto front, best (None for >1 objective),
   evaluation count, and generation count.

Internal Nsga2Entry { candidate, rank, crowding_distance } stays
private. Panics with clear messages on `population_size == 0` or
empty `vary` output. Tests cover population length, evaluation count,
non-empty front, and full determinism with the same seed (spec §18.4).
This commit is contained in:
2026-05-04 19:24:41 -06:00
parent bb3a01f90e
commit 33a927d86d
3 changed files with 274 additions and 1 deletions
+2
View File
@@ -1,7 +1,9 @@
//! Built-in reference optimizers.
pub mod nsga2;
pub mod paes;
pub mod random_search;
pub use nsga2::*;
pub use paes::*;
pub use random_search::*;