Skip to content

keep_elitism only works when crossover_type==None #132

Open
@mxflknbrg

Description

@mxflknbrg

With PyGAD 2.18.0 the keep_elitism=1 paramter was introduced. Apparently this only works when no crossover operation is selected. This is a strange behavior, because in my understanding Selection(e.g. Elitism) and Crossover build on each other. A normal (simplified) generation cycle should therefore look something like this:

  1. Init
  2. Evaluate fitness
  3. Selection (e.g. steady-state, rank, elitism)
  4. Crossover (e.g. one-point, uniform)
  5. Mutation (e.g. random, swap)
  6. -> 2.

To summarize, I would expect the elitism parameter to allow some of the best parents to pass unchanged into the next generation. This is not the case, and therefor the fitness value didn't converge.
Compare the lines 1348 - 1373 of the pygad.py file

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions