esa / pagmo2

A C++ platform to perform parallel computations of optimisation tasks (global and local) via the asynchronous generalized island model.
https://esa.github.io/pagmo2/
GNU General Public License v3.0
823 stars 161 forks source link

No "NaN/infinity" verification in sbx crossover implementation AND no bounds verification for NSGA-II's initial population #567

Open Dave-Poissant opened 7 months ago

Dave-Poissant commented 7 months ago

Describe the bug There is no NaN/infinity verification in the SBX Crossover implementation. This makes it possible for the crossover to assign NaN/infinity values to genes.

An example of how this seems to happen is when the population is set with genes that don't respect their bounds in NSGA-II (and maybe other genetic algorithm implementation). There should be a verification beforehand that all those genes respect the bounds set.

Expected behavior For NSGA-II

  1. An error message saying that the initial population have some individuals not respecting bounds OR those said individuals are bounded before executing the evolution. For sbx crossover impl
  2. A bounding step at the end of the crossover, making sure neither C1 or C2 are NaN/infinity values and then assigned to genes

Environment (please complete the following information):

Additional context I have not verified if other genetic algorithms have this problem nor if other crossover operators can assign NaN/infinity values. But this should be confirmed into the same pull request in my opinion.