Antonymous
Antonymous

Reputation: 43

Question about mating pool, selection and crossover

I am currently trying to coding a genetic algorithm which intended to find the optimal solution for timetable planning. I have successfully created the population and also able to calculate the fitness, what I confuse is that mating pool and the selection.

I am planning to do the tournament solution.

What I know So far is that I need to select a random number of candidate, and choose the "most fit" and the first parent. Repeat the step and find the second parent. the crossover each other. But How many crossovers I need to do? Until the same size of the population size that I set. then How about my original population?

Can Someone help me?

Upvotes: 0

Views: 807

Answers (1)

maxy
maxy

Reputation: 5457

Your original population dies. If you want to keep the best solution(s) you can copy it to the new population (this is called elitism). You then generate offspring until your new population is full. Have a look at this Outline of the Basic Genetic Algorithm.

Cross-over is just one way to make children "different" from parents (in addition to mutation). This is independent from how you select good parents (e.g. tournaments). But note that there are so many GA variants that this may not be true for all of them.

I would consider to start with only mutation (no cross-over). This is much easier to implement, and sometimes good enough. You can always add cross-over later and see if you get an improvement.

Upvotes: 2

Related Questions