pulsatrix
Loading...
Searching...
No Matches
nsga2.hpp File Reference

NSGA-II multi-objective survivor selection (Deb, Pratap, Agarwal, Meyarivan, "A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II," IEEE TEVC 6(2), 2002): fast non-dominated sorting, crowding distance, and truncation selection. More...

#include <algorithm>
#include <limits>
#include <numeric>
#include <stdexcept>
#include <vector>
#include "pulsatrix/individual.hpp"
Include dependency graph for nsga2.hpp:

Go to the source code of this file.

Namespaces

namespace  pulsatrix
 

Typedefs

using pulsatrix::Objectives = std::vector< double >
 

Functions

bool pulsatrix::Dominates (const Objectives &a, const Objectives &b)
 Pareto dominance (maximization convention): a dominates b iff a[i] >= b[i] for every objective i, and a[i] > b[i] for at least one objective.
 
std::vector< std::vector< size_t > > pulsatrix::FastNonDominatedSort (const std::vector< Objectives > &objectives)
 Fast non-dominated sort (Deb et al. 2002, Algorithm: fast-non-dominated-sort): partitions [0, objectives.size()) into fronts – front 0 is the non-dominated set, front 1 is non-dominated after removing front 0, and so on.
 
std::vector< double > pulsatrix::CrowdingDistance (const std::vector< Objectives > &front_objectives)
 Crowding distance within a single front.
 
template<typename Genotype >
std::vector< Individual< Genotype, Objectives > > pulsatrix::NSGA2Replacement (const std::vector< Individual< Genotype, Objectives > > &population, std::vector< Individual< Genotype, Objectives > > offspring, size_t mu)
 NSGA-II survivor selection: combines population and offspring, fast-non-dominated- sorts the pool, includes whole fronts (best first) until the next front would overflow mu, then fills the remainder from that final front by crowding distance (largest first – more diverse/isolated solutions preferred).
 

Detailed Description

NSGA-II multi-objective survivor selection (Deb, Pratap, Agarwal, Meyarivan, "A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II," IEEE TEVC 6(2), 2002): fast non-dominated sorting, crowding distance, and truncation selection.

Note
Fortin & Parizeau, "Revisiting the NSGA-II Crowding-Distance Computation," GECCO 2013, is this campaign's own standing citation (research doc research_2026_evolutionary_deep_learning.md §1, §5) for verifying a from-scratch crowding-distance implementation against the corrected algorithm rather than a naive textbook description. This implementation's own specific correctness precautions (documented on CrowdingDistance below): a stable per-objective sort for deterministic tie-breaking, and skipping (not dividing by zero on) any objective that is uniform across an entire front.
Multi-objective fitness uses FitnessT = std::vector<double> (one entry per objective) – Individual<Genotype, FitnessT> (individual.hpp) already supports this directly, no new genotype/fitness container needed. Convention: maximization in every objective, consistent with this campaign's scalar-fitness operators (selection.hpp).