Answers.Body: <p>The disabled/enabled bit in a connection gene indicates whether or not it should be expressed in the calculation of the network.</p>
  
  <p>Here's an example:
  <a href="https://i.sstatic.net/CliXP.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/CliXP.png" alt="enter image description here"></a></p>
  
  <p>This is a neural network and its corresponding connection genes which represent the layout of the network among other things.
  The top connection gene going from 1 -> 3 that has a weight of 0.1 is expressed in the calculation of the network.
  The bottom connection gene going from 2 -> 3 that has a weight of 0.4 is not expressed in the calculation of the network.</p>
  
  <p>Calculating the network:</p>
  
  <blockquote>
    <p>1633 * 0.1 = 163.3</p>
    
    <p>Given the weights in the example the output of this network is 163.3</p>
  </blockquote>
  
  <p>Hypothetically, if both connection genes had their enabled bit set to true (which can happen in the future, to quote the paper: "The disabled genes may become enabled again in future generations") then the output of the network would be:</p>
  
  <blockquote>
    <p>(1633 * 0.1) + (10 * 0.4) = 167.3</p>
  </blockquote>
  
  <p>To answer your question, the connection between two nodes still exists in the network regardless of whether the bit in the gene is enabled or disabled, but, if the bit in the gene is disabled it is not used when the output of the network is being calculated as I've shown above.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-19T17:43:40.070Z
Answers.LastActivityDate: 2018-09-19T18:03:50.660Z
Answers.LastEditDate: 2018-09-19T18:03:50.660Z
Answers.UserDisplayName: Chris
Body: <p>I'm currently implementing the original NEAT algorithm in Swift.</p>
  
  <p>Looking at figure 4 in Stanley's original paper, it seems to me there is a chance that node 5 will have no (enabled) outgoing connection if parent 1 is assumed the fittest parent and the connection is randomly picked from parent 2.</p>
  
  <p>Is my understanding of the crossover function correct and can it indeed result in a node with no outgoing connections?</p>
  
Tags: <neat>
Title: Can a crossover result in a node with no outgoing connections?
UserDisplayName: Daniël
ThreadText: # Can a crossover result in a node with no outgoing connections?
  
  (Asked by: username_0 on 2018-09-15)
  
  I'm currently implementing the original NEAT algorithm in Swift.
  
  Looking at figure 4 in Stanley's original paper, it seems to me there is a chance that node 5 will have no (enabled) outgoing connection if parent 1 is assumed the fittest parent and the connection is randomly picked from parent 2.
  
  Is my understanding of the crossover function correct and can it indeed result in a node with no outgoing connections?
  
  **Tags:** neat
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-09-19. Score: 0 | Accepted answer
  
  The disabled/enabled bit in a connection gene indicates whether or not it should be expressed in the calculation of the network.
  
  Here's an example:
  [![enter image description here](https://i.sstatic.net/CliXP.png)](https://i.sstatic.net/CliXP.png)
  
  This is a neural network and its corresponding connection genes which represent the layout of the network among other things.
  The top connection gene going from 1 -> 3 that has a weight of 0.1 is expressed in the calculation of the network.
  The bottom connection gene going from 2 -> 3 that has a weight of 0.4 is not expressed in the calculation of the network.
  
  Calculating the network:
  
  > 1633 \* 0.1 = 163.3
  >
  > Given the weights in the example the output of this network is 163.3
  
  Hypothetically, if both connection genes had their enabled bit set to true (which can happen in the future, to quote the paper: "The disabled genes may become enabled again in future generations") then the output of the network would be:
  
  > (1633 \* 0.1) + (10 \* 0.4) = 167.3
  
  To answer your question, the connection between two nodes still exists in the network regardless of whether the bit in the gene is enabled or disabled, but, if the bit in the gene is disabled it is not used when the output of the network is being calculated as I've shown above.
  
  
  ---
  
  