General question about crossover operator for a genetic algorithm

Click For Summary

Discussion Overview

The discussion revolves around the design and implementation of crossover operators in genetic algorithms (GAs), exploring their necessity, effectiveness, and variations. Participants share insights on how crossover interacts with fitness functions and the overall goals of genetic algorithms.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Conceptual clarification

Main Points Raised

  • One participant questions whether a child produced by the crossover operator should have higher fitness than its parents, suggesting that the selection function may suffice for improving population fitness over time.
  • Another participant explains that the effectiveness of crossover depends on the goals of the genetic algorithm, providing a metaphorical explanation of discarding less fit children.
  • A detailed overview of common methods for creating new populations is provided, including elite children, crossover, and mutation, emphasizing that crossover may not necessarily produce offspring with higher fitness than their parents.
  • Concerns are raised about the applicability of traditional crossover methods (single-point, two-point, uniform) for individuals represented as permutations, with a participant seeking alternative crossover methods suitable for such representations.
  • It is noted that crossover can involve various techniques beyond the traditional methods, particularly for different data structures like trees.

Areas of Agreement / Disagreement

Participants express differing views on the necessity of offspring fitness relative to parent fitness, and there is no consensus on the best crossover methods for specific representations like permutations. The discussion remains unresolved regarding the optimal crossover strategies.

Contextual Notes

Participants mention that the implementation details of genetic algorithms can vary significantly, which may affect the choice of crossover methods and their effectiveness.

markiv
Messages
26
Reaction score
0
Hey guys, this is my first time working on a genetic algorithm. It seems to me that the algorithm is primarily defined by how you choose to define your crossover operator and fitness function. Let's say the crossover takes two parents and produces one child. Is it necessary/good/bad/etc that the child should have a higher fitness than either of its parents? Or do we let the selection function take care of making sure that our population increases in fitness over time?
 
Technology news on Phys.org
It technically depends on the goal of you GA, but the way that I had it explained to me was this:

You take an initial population of M and F parents. You combine them and produce children. You take the children with a lower fitness than your continuation criteria, you shoot them in the head, and you move on. Morbid, but it does a good job of getting the point of the algorithm.

What language are you writing in? I have an evolutionary algorithm written in Fortran 90 from a few years ago that you could take a look at. It's from college, so it's not perfect, but it might give you good ideas.
 
Artificial Intelligence - A Modern Approach by Russell and Norvig and Machine Learning by Mitchell offer high level overviews of genetic algorithms.

The population's overall fitness will increase over time due to the way the GA works. It's common to basically have three ways to create the new population:
  1. Elite children
  2. Crossover
  3. Mutation
Elite children are the elements of the population with the highest fitness. A fixed number of these elites will automatically join the next generation.

Crossover combines two individuals to produce two offspring. The parents are generally chosen probabilistically according to the following function, where h is an individual hypothesis, \Phi(h) is the fitness function, and n is the population size:
P(h_i \text{ is selected}) = \frac{\Phi(h_i)}{\sum_{j=1}^n \Phi(h_j)}
Then, you either do single-point crossover, two-point crossover, or uniform crossover to create two offspring.

Mutation is then applied to the population. Generally speaking, a percentage of the population is chosen with uniform probability and each chosen individual has a random bit inverted.

So, basically, the fitness function drives which individuals are selected to move on; technically speaking, the fitness function solely assigns a numerical score representing the quality of the hypothesis; the actual genetic algorithm decides which individuals are kept. Crossover is a method to generate new individuals which may or may not be more fit than the parents.

Of course, the above details can change based on the way the GA is implemented.
 
Thanks for the feedback.

swartzism said:
What language are you writing in? I have an evolutionary algorithm written in Fortran 90 from a few years ago that you could take a look at. It's from college, so it's not perfect, but it might give you good ideas.
The final program will likely be written in C, but I may write it in Python first for proof of concept. If you do have code though, I'd like to look at it.

jhae2.718 said:
Artificial Intelligence - A Modern Approach by Russell and Norvig and Machine Learning by Mitchell offer high level overviews of genetic algorithms.

The population's overall fitness will increase over time due to the way the GA works. It's common to basically have three ways to create the new population:
  1. Elite children
  2. Crossover
  3. Mutation
Elite children are the elements of the population with the highest fitness. A fixed number of these elites will automatically join the next generation.

Crossover combines two individuals to produce two offspring. The parents are generally chosen probabilistically according to the following function, where h is an individual hypothesis, \Phi(h) is the fitness function, and n is the population size:
P(h_i \text{ is selected}) = \frac{\Phi(h_i)}{\sum_{j=1}^n \Phi(h_j)}
Then, you either do single-point crossover, two-point crossover, or uniform crossover to create two offspring.

Mutation is then applied to the population. Generally speaking, a percentage of the population is chosen with uniform probability and each chosen individual has a random bit inverted.

So, basically, the fitness function drives which individuals are selected to move on; technically speaking, the fitness function solely assigns a numerical score representing the quality of the hypothesis; the actual genetic algorithm decides which individuals are kept. Crossover is a method to generate new individuals which may or may not be more fit than the parents.

Of course, the above details can change based on the way the GA is implemented.
Thanks a lot for the references, they look very good. After browsing around the internet about GA, though, there's this question that keeps coming up that I haven't found an answer to. I know single-point, two-point, and uniform crossovers are all different ways to crossover two individuals, but are these the only ways to perform a crossover? For example, I'd like to represent each individual in my population as pair of permutations, but permutations don't exactly lend themselves to these types of crossover. I've thought of ways of "combining" two individuals in such a way that the offspring "resembles" the parents, but they aren't any of the 3 mentioned above. Must they be so?
 
Crossover is basically just swapping parts of two parents to create two children, so you're fine. There are other types of crossover defined for different types of individuals; trees for example can't use the types of crossover defined above.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
Replies
7
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
10K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
20
Views
5K
Replies
29
Views
6K
  • · Replies 1 ·
Replies
1
Views
3K