Home  >  Article  >  What are the basic steps of genetic algorithm

What are the basic steps of genetic algorithm

coldplay.xixi
coldplay.xixiOriginal
2020-08-31 13:40:2752835browse

The basic steps of the genetic algorithm are: 1. Initialization; 2. Individual evaluation; 3. Selection operation; 4. Crossover operation; 5. Mutation operation, applying the mutation operator to the population; 6. Termination condition judgment .

What are the basic steps of genetic algorithm

The basic steps of the genetic algorithm are:

(1) Initialization: Set the evolutionary algebra counter t=0, Set the maximum evolutionary generation T, and randomly generate M individuals as the initial population P(0).

(2) Individual evaluation: Calculate the fitness of each individual in the group P(t).

(3) Selection operation: Apply the selection operator to the group. The purpose of selection is to directly inherit optimized individuals to the next generation or to generate new individuals through pairwise crossover and then inherit them to the next generation. The selection operation is based on the fitness assessment of individuals in the group.

(4) Crossover operation: Apply the crossover operator to the group. The crossover operator plays a core role in the genetic algorithm.

(5) Mutation operation: Apply mutation operator to the population. That is to change the gene values ​​at certain loci of individual strings in the population. After the population P(t) undergoes selection, crossover, and mutation operations, the next generation population P(t 1) is obtained.

(6) Termination condition judgment: If t=T, the individual with the maximum fitness obtained during the evolution process will be output as the optimal solution and the calculation will be terminated.

The above is the detailed content of What are the basic steps of genetic algorithm. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn