NEAT algorithm: How to crossover disjoint and excess genes?
Asked Answered
C

3

10

I am currently implementing the NEAT algorithm developed by Kenneth Stanley, taking the original paper as a reference.

In the section where the crossover method is described, one thing confuses me a little bit.

enter image description here

So, the above figure is illustrating the crossover method for NEAT. To decide from which parent a gene inherited, the paper says the following:

Matching genes are inherited randomly, whereas disjoint genes (those that do not match in the middle) and excess genes (those that do not match in the end) are inherited from the more fit parent.

For the matching genes (1 - 5) it's easy to understand. You just randomly inherit from either Parent1 or Parent2 (with 50% chance for both). But for the disjoint (6-8) and excess (9-10) genes you cannot inherit from the more fit parent because you only have those genes in either Parent1 or Parent2.

For example:

Parent1's fitness is higher than Parent2's. The disjoint gene 6 only exists in Parent2 (of course, because disjoint and excess genes only occur in one parent) So, you cannot decide to inherit this gene from the more fit parent. Same goes for all other disjoint and excess genes. You can only inherit those from the parent they exist in.

So my question is: Do you maybe inherit all matching genes from the more fit parent and just take over the disjoint and excess genes? Or do i missunderstand something here?

Thanks in advance.

Cowen answered 27/5, 2018 at 15:47 Comment(0)
R
6

It might help to look at the actual implementation and see how it is handled. In the original C++ code here (look at lines 2085 onwards), the disjoint and excess genes from the unfit parent seem to be just skipped.

In your implementation, you could inherit disjoint and excess genes from the unfit parent but disable them with probability 1 so you can do pointwise mutations on them (toggle disabled to enabled) later on. However, this might result in significant genome bloat, so test and see what works.

Reduce answered 30/5, 2018 at 23:50 Comment(2)
Thanks, the implementation clears things up. I think i will try your suggestion and see how it works.Cowen
"the disjoint and excess genes from the unfit parent seem to be just skipped" works for me. I am surprised this question is no more popular. The original paper about NEAT is absolutely not clear about the semantic of the crossover.Premeditate
B
1

It makes more sense to take mismatching genes only from 'more fit parent'. This will create strong offspring as a result of crossover. For matching genes, apply usual crossover operator. For improving diversity, create second offspring by random selection of mismatching genes from two parents.

In this way, First offspring will be more fit and second offspring will maintain diversity. Hope, this helps.

Birk answered 4/10, 2018 at 10:14 Comment(0)
N
1

The graphic depicts the special case of two parents with the same fitness, so selection is random again and therefore could lead to the depicted case. I agree that it is misleading without that additional piece of information.

Nisse answered 21/4, 2021 at 9:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.