Genetic Algorithm and direct search toolbox study note 10-Working Principle of Genetic Algorithm

Source: Internet
Author: User

How genetic algorithms work

1. algorithm Overview

The following outline summarizes the algorithm work process.

1. The algorithm generates an initial and random population.

2. Algorithms generate a series of new populations. In each step of the algorithm, the algorithm uses the individual of the current population to generate the next generation of the population. To generate a new population, the algorithm performs the following steps:

A. Calculate the fitness value to score the individual in each group.

B. Calibrate the original fitness value to a certain data range.

C. select members in the group based on the fitness value, which is called the parent generation.

D. Some individuals in the current group have lower fitness values, known as "elites" who are directly copied to the next generation.

E. Generate children from the parent generation. There are two ways to generate a child: Use the crossover method to generate the next generation or use the Variant Method to generate the next generation.

F. Replace the individual in the current group with the generated child individual to generate the next generation.

3. When the algorithm meets any criteria in the Stop standard, the algorithm stops.

Ii. initialize the population

The algorithm starts with a random initial population. Indicates the initialized population.

In this example, the initial group contains 20 individuals. 20 is in the algorithm population option panelPopulation size. Note: here the individual is located in the upper right corner of the quadrant, And the range is [0; 1], because in the population panelInitial rangeThe default value is [0; 1].

3. Generate the next generation

In each step of the algorithm, the algorithm uses the current group to generate the child, and then forms the next generation. Based on the fitness value, the algorithm selects an individual in the parent generation to generate a child. You canSelectionSettings in the panelSelection FunctionOption to specify a specific function to select the parent generation.

Genetic algorithms use three methods to generate individual in the child.

3.1 members with the optimal fitness value in the current group form an "elite team", which will be copied directly to the next generation as one of the next generation groups.

3.2 generate a cross-Child individual through a pair of parent individuals.

3.3 Use a parent generation to generate a variant child through a random change or mutation operation.

The following schematic diagram describes three ways to generate individual child generations.

 

Iv. Drawing of iterative images of later Algorithms

60 iterations are individual distribution charts

Distribution chart of 80 iterations

95-generation iteration distribution chart

Distribution of 100 iterations

With the increasing number of iterative algebra algorithms, individuals in a group gradually approach the point where the global optimal value is located [0 0].

5. algorithm stop Conditions

The algorithm uses the following conditions to determine the algorithm stop time.

Generations---- Iteration algebra. When the number of times the algorithm runs exceeds the specified number of iterations, the algorithm stops.

Time limit -----When the algorithm runs beyond the specified interval, the algorithm stops running.

Fitness limit------ When the algorithm runs and the fitness value is smaller than the value specified by this option, the algorithm stops running.

Stall generations -----When the algorithm is in the algebra specified by stall generations, the weighted average variation of the fitness function is lessFunction tolerance, the algorithm stops running.

Stall time limit ------When the algorithm isStall Time LimitThe algorithm stops if the target function value is not improved during the specified time interval.

Function tolerance------ SeeStall generations.

Nonlinear constraint tolerance ------This option is generally not used as a condition for algorithm stop. It is often used to measure the feasibility of Nonlinear Constraints.

You can use the preceding metrics in the optimization toolboxStopping criteriaIn the panel, you can change them according to the actual situation. Is the default value of these options

When you run the algorithmRun Solver and view resultsThe reason why the algorithm stops running is displayed on the panel.

MediumStall Time LimitAndTime LimitIt is to prevent the algorithm from running for too long. If the algorithm stops because of these two options, you canStall Time LimitAndTime LimitTo improve the running effect of the algorithm.

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.