Edge Recombination Example
Given our parents:
Parent 1: A B F E D G C
Parent 2: G F A B C D E
First, we randomly select the first node of a parent.
CHILD: A
Next, after crossing A out from all neighbor lists, we see that B is the least full list. So,
CHILD: A B
Next, after crossing B out from all neighbor lists, F and C both have only 2 neighbors, so we randomly choose between the two:
CHILD: A B F
Next, after crossing F out from all neighbor lists, E is the neighbor of F that has the fewest neighbors.
CHILD: A B F E
Next, after crossing E out from all neighbor lists, D and G both have only 2 neighbors, so we randomly choose between the two:
CHILD: A B F E G
Next, after crossing G out from all neighbor lists, D and C both have only 1 neighbor, so we randomly choose between the two:
CHILD: A B F E G C
Next, after crossing C out from all neighbor lists, C has only one neighbor and it has no neighbors left, so we randomly choose between the nodes that aren't yet included in CHILD. In this case, D is the only one left, so we're done:
CHILD: A B F E G C D
|