Classical Algorithm Research Series: 7. Exploring genetic algorithms and analyzing the essence of GA

Source: Internet
Author: User

This article reference: Wikipedia South China University of Technology electronic handouts Internet

-------------------------------------------------------------------------------

 

I. Preliminary Research on Genetic Algorithms

OK. Let's take a look at Wikipedia's explanation of genetic algorithms:

Genetic algorithms are the search algorithms used in computational mathematics to solve optimization, and are a type of evolutionary algorithms. Evolutionary algorithms developed from some phenomena in evolutionary biology, including genetics, mutation, natural selection, and hybridization.

 

Generally, genetic algorithms are implemented by computer simulation. For an optimization problem, a certain number of evolutionary solutions (called individual) abstract representation (called chromosome) populations are better evolved. Traditionally, the solution uses binary representation (a string of 0 and 1), but other representation methods can also be used. Evolution begins with the population of completely random individuals, and occurs in the next generation. In each generation, the fitness of the entire population is evaluated. Multiple individuals are randomly selected from the current population (based on their fitness), and a new life population is generated through natural selection and mutation, this population becomes the current population in the next iteration of the algorithm.

 

The definition may not be clear. Let's give a few clear illustrations, steps, and formulas:

Diagram of the basic genetic algorithm:

 

Therefore, the basic steps of the genetic algorithm are as follows:

1) initialize the t ← 0 evolutionary algebra counter; T is the largest evolutionary algebra; randomly generate M individuals as the initial group P (t );

2) individual evaluation calculates the fitness value of each individual in P (t;

3) The selection operation selects the operator to act on the group;

4) crossover Operations Act on the group;

5) The mutation operation acts on the population and obtains the next generation population P (t + 1) through the above operation );

6) Determination of the condition for termination t: T branch t + 1 to step 2;

T> T: Terminate the output solution.

 

Okay. Let's take a look at the pseudo-code implementation of the genetic algorithm:

▲Procedures GA: pseudocode

Begin

Initialize P (0 );

T = 0 ;//T is an evolutionary algebra, Generation 1, generation 2, generation 3...

While (t <= T) do

For I = 1 to M do //M is the number of individuals in the initial population.

Evaluate fitness of P (t); // calculate the fitness of each individual in P (t)

End

For I = 1 to M do

Select operation to P (t); // apply the selection operator to the group

End

For I = 1 to M/2 do

Crossover operation to P (t); // apply a Crossover operator to a group

End

For I = 1 to M do

Mutation operation to P (t); // apply the Mutation operator to the population

End

For I = 1 to M do

P (t + 1) = P (t); // obtain the next generation group P (t + 1)

End

T = t + 1; // condition for determining the termination t: T ← t + 1 to step 2

End while

End

 

Ii. Deep Dive into Genetic Algorithms

1. Overview of Intelligent Optimization Algorithms

Intelligent Optimization Algorithms, also known as modern heuristic algorithms, are an algorithm with global optimization performance, versatility, and suitable for parallel processing.

This algorithm generally has a strict theoretical basis, rather than simply relying on expert experience. In theory, we can find the optimal solution or approximate optimal solution within a certain period of time.

Genetic algorithms are one of the intelligent optimization algorithms.

 

Common intelligent optimization algorithms include:

Genetic algorithm, simulated annealing algorithm, Taboo Search Algorithm, particle swarm algorithm, and ant colony algorithm.

(In this series of classical algorithms, we will introduce simulated annealing algorithms, particle swarm algorithms, and ant colony algorithms in the future .)

 

2. Genetic Algorithm Overview

Genetic algorithms were first proposed by Professor J. Holland of the United States in his 1975 monograph "adaptability to natural and artificial systems.

The randomization search algorithm based on natural selection in the biological field and natural genetic mechanism is used for reference.

Simulate reproduction, crossover, and genetic mutation during natural selection and natural inheritance.

 

In each iteration, a group of regression solutions are retained, and a better individual is selected from the solution group based on certain indicators. The genetic operators (selection, crossover, and mutation) are used

Body to generate a new generation of batch solution groups. repeat this process until certain convergence metrics are met.

 

Simple Genetic Algorithms (GA) are also known as Simple Genetic Algorithms or standard Genetic Algorithms, its genetic evolution process is simple and easy to understand. It is the prototype and basis of some other genetic algorithms.

 

3. Composition of basic genetic algorithms

(1) coding (generating the initial population)

(2) fitness functions

(3) genetic operators (selection, crossover, and mutation)

(4) Running Parameters

 

Next we will discuss the five components of the basic genetic algorithm in different categories:

1. Encoding

The genetic algorithm (GA) abstracts an object into a string of specific symbols in a certain order through a certain encoding mechanism.

Just as biological genetics begins with chromosomes, chromosomes are lined up by genes.

The basic genetic algorithm (SGA) uses binary strings for encoding.

 

Initial population: the basic genetic algorithm (SGA) uses a random method to generate a set of several individuals. This set is called the initial population.

The number of individuals in the initial population is called the population size.

 

2. fitness functions

Genetic algorithms use the fitness function value to evaluate the performance of each individual (solution). The larger the fitness function value, the better the solution quality.

Fitness functions are the driving force behind the evolution of genetic algorithms and the only criterion for natural selection,

Its design should be based on the requirements for solving the problem itself.

 

3.1. Selection Operator

The genetic algorithm uses the selection operation to survive the fittest for an individual.

Individuals with high fitness are more likely to be inherited from the next generation. Individuals with low fitness are less likely to be inherited from the next generation.

The task of selecting an operation is to select some individuals from the parent group and inherit them to the next generation group.

The selection operator in the basic genetic algorithm (SGA) adopts the round-robin selection method.

 

OK. Let's take a look at this.This example is easy to understand,It is helpful for understanding the selection operator.

Related Article

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.