Layla
Layla

Reputation: 5476

general algorithm of tournament selection

I have a question about how to use a tournament selection in GA. Suppose that I have 100 individuals as an initial population and then I want to apply tournament selection for n generations, so I end up with only 20% of chromosomes for each iteration. The algorithm that I came up with is:

choose 20% of the initial population
while (not end of iterations)
    select randomly n individuals from the left population (20%)
    if (number of chromosomes greater than two)
        select the best and mutate
        add to the population
    if (number of chromosomes greater than three)
        select best two of each pair and crossover them
        add crossover product to the population
    repeat process with new population
end while

is this schema correct? Thanks

Upvotes: 0

Views: 714

Answers (2)

Novak
Novak

Reputation: 4779

It could be, but it depends on some of the details of what you're doing in that outline:

  • The individuals chosen for the tournament need to be the most fit individuals of the generation
  • The individuals chosen from the tournament need to be chosen in some proportion to their fitness
  • When you generate new individuals for the next population, you need to generate enough to bring the population back up to its previous level

In addition, that said:

  • Culling to 20% seems very steep to me
  • Usually the number of parents is fixed, not variable or random
  • Usually (but not always) the number of parents is two, as the more parents you have, the less likely you are to preserve longer beneficial schemata

Upvotes: 0

Andreas
Andreas

Reputation: 6475

Disregarding 80% of the population is not the intention of the GA. Why do you have them anyway? This will increase genetic drift and lead to premature convergence.

Tournament selection works such that you take n individuals and then take the best individual as parent 1. Then you take n individuals again and obtain parent 2. These are the ones that you cross.

For a population of size 100 binary tournament should usually excert enough selection pressure.

Upvotes: 2

Related Questions