# Disabling of genes during crossover (NEAT)

I am implementing NEAT (Neuroevolution of augmenting topologies) by Stanley, Original Paper. I am facing a problem during crossover of genomes. Suppose two networks with connections

Genome1 = { (1, Input1, Output), //Numbers represent innovation numbers (2, Input2, Output) } //More Fit Genome2 = { (1, Input1, Output), (2, Input2, Output), //Disabled (3, Input2, Hidden1), (4, Hidden1, Output) }

are crossed over, then the connection (Input2, Output) in the fitter parent has a chance of being disabled,

There’s a preset chance that an inherited gene is disabled if it is disabled in either parent. (Pg. 109, Section 3.2, Figure 4)

and thus producing the following offspring:

Child = { (1, Input1, Output), (2, Input2, Output) //Disabled }

and thus render the network non functional. Similarly by this chance nodes can get left in a state of uselessness after crossover (As having no outgoing connections or no connections at all). How can this be prevented or am I missing something here?

• Hi and welcome to this community Samuel! Have you tried to look at existing implementations of NEAT? By looking at the existing implementations of NEAT, you might find how others have solved or avoided this issue or if you're actually misunderstanding something.
– nbro
Jul 7 '19 at 18:41
• I had tried it but found it particularly difficult. But at this point it seems that is the only way I have so I'll give it another try. Thank you for suggesting!. Jul 17 '19 at 18:07

In your example, the output node would still get a value from Input1, even though Input2 is disabled.

If the child was:

Child = {
(1, Input1, Output1),
(2, Input2, Output2) //Disabled
}


Then Output2 would return 0, meaning it wasn't activated.

For your second question, it is up to your implementation. You could:

1.) Use only the connection genes in crossover, and derive your node genes from the connection genes

2.) Test if every node is in use, and delete the ones that are not

• Your 2nd suggestion is in my opinion the most logical solution to this problem. Thank you! Aug 28 '19 at 18:06