<p>The usual course is to feign ignorance and let it happen.</p>

<p>However, it is generally bad, so you'd ideally take steps to make it less likely to happen. The brute force solution is of course to simply check for equality and reselect one of the parents if necessary. You can do this, but there's a decent chance that if all you do is throw away the duplicates, the overhead of checking every time may start to limit the returns you get.</p>

<p>Another way to minimize these effects is to use a selection operator that is less biased. Roulette-wheel selection has a very high probability of selecting from only the handful of best individuals in many cases (depends on the particular distribution of fitness values of course). You're probably better off starting off with tournament selection as your default choice. It will give you a wider coverage of the parent pool, which keeps more diversity around for longer. Also, you can tweak the knobs a bit by looking at how you do environment selection (replacing old parents by some combination of old parents and new offspring). The more strongly elitist you are, the faster you'll converge, which you usually want to avoid.</p>

<p>One of the best black-box GAs out there is CHC (Eshelman, 1990) (always be wary of black boxes, but if you're going to treat the method as one, CHC seems to be one of the more effective ones). CHC is worth looking at, partly because it is a pretty good search algorithm, and partly because it provides a window into the types of things you can do to a standard GA to try and exert a bit more control over what it's doing.</p>

<p>CHC takes a very odd approach. It pairs parents completely randomly and without replacement. This means that every parent is selected exactly once (recombination produces two offspring, so each parent is selected as part of one mating pair giving N/2 pairs * 2 offspring/pair = N offspring). Crossover is "HUX" or half-uniform crossover, which produces offspring maximally distant from their parents. Combined, these give a very explorative search. In addition though, it is maximally elitist. Of the N parents and N offspring, the best N of the total are kept. This drives convergence very quickly -- very exploitative. Finally, parents produce no offspring at all if they are closer than a threshold value to one another. The threshold starts at L/4 (L=length of encoding), and is decremented each time zero offspring are produced in a generation. Thus the number of offspring produced in each generation is variable, and this number is used to determine how much the population has converged. At some point, when it has converged sufficiently (when the threshold reaches zero), CHC performs a "cataclysmic mutation" in which all but one individual have 35% of their bits randomly flipped and the process restarts.</p>

<p>Unfortunately the original paper describing CHC is only available in dead-tree form as far as I know. However, you can find a few descriptions online and in other papers that reference it.</p>

CC BY-SA 3.0
2012-05-08T09:33:05.260Z
2012-05-08T09:33:05.260Z
deong
<p>Having crossover between the same individual can lead to local optima where only that individual will stay in the population. However, this is not always the case, it is best to test each of your ideas to your own problem :)</p>

CC BY-SA 3.0
2012-05-08T06:51:25.370Z
2012-05-08T06:51:25.370Z
Mihai Maruseac
<p>I have a working genetic algorithm which uses a few genetic operators on pairs of individuals.</p>

<p>These two individuals are selected by fitness-proportional (roulette-wheel) selection, that is, an individual's likelihood of being selected is proportional to its fitness.</p>

<p>The way a pair is selected is simply by selecting a single individual from the population twice. Sometimes, the same chromosome can be selected twice, and then all genetic operators are simply operating on two copies of the same individual.</p>

<p>For example, crossover is meaningless in this case.</p>

<p>My question is, should I take measures to ensure the pair that are selected are not equal?</p>

<p>Or should I mitigate the problem by performing operators on single individuals first (such as mutation), so the pair are more likely to be different when it comes to things like crossover?</p>

<p>Or should I ignore the problem completely, "let nature take its course", and allow an individual to breed with itself?</p>

<ne.neural-evol><genetic-algorithms>
Selection in a genetic algorithm
Ivy
# Selection in a genetic algorithm

(Asked by: username_0 on 2012-05-08)

I have a working genetic algorithm which uses a few genetic operators on pairs of individuals.

These two individuals are selected by fitness-proportional (roulette-wheel) selection, that is, an individual's likelihood of being selected is proportional to its fitness.

The way a pair is selected is simply by selecting a single individual from the population twice. Sometimes, the same chromosome can be selected twice, and then all genetic operators are simply operating on two copies of the same individual.

For example, crossover is meaningless in this case.

My question is, should I take measures to ensure the pair that are selected are not equal?

Or should I mitigate the problem by performing operators on single individuals first (such as mutation), so the pair are more likely to be different when it comes to things like crossover?

Or should I ignore the problem completely, "let nature take its course", and allow an individual to breed with itself?

**Tags:** ne.neural-evol, genetic-algorithms


---

## 2 answers

### Answer by username_1 on 2012-05-08. Score: 6

The usual course is to feign ignorance and let it happen.

However, it is generally bad, so you'd ideally take steps to make it less likely to happen. The brute force solution is of course to simply check for equality and reselect one of the parents if necessary. You can do this, but there's a decent chance that if all you do is throw away the duplicates, the overhead of checking every time may start to limit the returns you get.

Another way to minimize these effects is to use a selection operator that is less biased. Roulette-wheel selection has a very high probability of selecting from only the handful of best individuals in many cases (depends on the particular distribution of fitness values of course). You're probably better off starting off with tournament selection as your default choice. It will give you a wider coverage of the parent pool, which keeps more diversity around for longer. Also, you can tweak the knobs a bit by looking at how you do environment selection (replacing old parents by some combination of old parents and new offspring). The more strongly elitist you are, the faster you'll converge, which you usually want to avoid.

One of the best black-box GAs out there is CHC (Eshelman, 1990) (always be wary of black boxes, but if you're going to treat the method as one, CHC seems to be one of the more effective ones). CHC is worth looking at, partly because it is a pretty good search algorithm, and partly because it provides a window into the types of things you can do to a standard GA to try and exert a bit more control over what it's doing.

CHC takes a very odd approach. It pairs parents completely randomly and without replacement. This means that every parent is selected exactly once (recombination produces two offspring, so each parent is selected as part of one mating pair giving N/2 pairs \* 2 offspring/pair = N offspring). Crossover is "HUX" or half-uniform crossover, which produces offspring maximally distant from their parents. Combined, these give a very explorative search. In addition though, it is maximally elitist. Of the N parents and N offspring, the best N of the total are kept. This drives convergence very quickly -- very exploitative. Finally, parents produce no offspring at all if they are closer than a threshold value to one another. The threshold starts at L/4 (L=length of encoding), and is decremented each time zero offspring are produced in a generation. Thus the number of offspring produced in each generation is variable, and this number is used to determine how much the population has converged. At some point, when it has converged sufficiently (when the threshold reaches zero), CHC performs a "cataclysmic mutation" in which all but one individual have 35% of their bits randomly flipped and the process restarts.

Unfortunately the original paper describing CHC is only available in dead-tree form as far as I know. However, you can find a few descriptions online and in other papers that reference it.


---

### Answer by username_2 on 2012-05-08. Score: 0

Having crossover between the same individual can lead to local optima where only that individual will stay in the population. However, this is not always the case, it is best to test each of your ideas to your own problem :)


---

