# What is new population in genetic algorithm?

Here is my (mis?)understanding of genetic algorithm:

1. Create n individuals. This is initial population
2. Calculate fitness of each individual in this population
3. for i in range(n): select two individuals randomly with replacement from population with probability of selection of each individual proportional to its fitness value cross over the two selected individuals to create two offsprings introduce mutation
4. Calculate fitness value for each offspring

Now you have an initial population of n and n offsprings.

What comes now?

Is my new population the n offsprings or the n fittest individuals of the 2n (n population + n offsprings) available?

In the simplest implementations, you simply discard the old population and maintain a population of size $n$ in each generation.
• Keep a top number (say $m$) of the original population, and only generate $n-m$ new offspring in each generation.