An improved adaptive genetic algorithm

. Genetic algorithm is a classic intelligent bionic algorithm, which is evolved according to the genetic evolution process of organisms in nature, and has strong global optimization ability. Firstly, this paper expounds the basic principle of genetic algorithm, which comes from the viewpoint of "survival of the fittest and survival of the fittest" in Darwin's theory of evolution, introduces the main characteristics of the algorithm, and summarizes the shortcomings of the algorithm. Based on the specific running steps of genetic algorithm, aiming at the shortcomings of genetic algorithm, an improved adaptive genetic algorithm is proposed. Finally, an example is used for simulation. The simulation results show that the improved algorithm has certain advantages.


Introduction
Genetic algorithm (GA) is a classical algorithm among natural heuristic algorithms.It was first proposed by John Holland of the University of Michigan in the 1960s.As the name suggests, genetic algorithm is an algorithm designed and implemented according to the process of biological heredity and evolution in nature.With the progress of the times and the development of science and technology, the performance of computer has been qualitatively improved, and genetic algorithm has gradually entered the field of practical application from the theoretical level.As a framework algorithm that can effectively solve complex optimization problems, genetic algorithm has become more and more abundant under the in-depth research of scholars and is widely used in many fields such as computational science, commerce, agriculture and so on.

Genetic algorithms
Genetic algorithm learns from the evolution mode of natural organisms, algorithmizes the process of biological evolution, and simulates it on the computer, so as to solve the optimization problems in the actual field.It is a global search algorithm that can avoid being limited to the local maximum.It will randomly generate different kinds of problem solutions and select more favourable solutions according to the principle of survival of the fittest.It will further iterate and optimize the solutions through heredity and variation, which is similar to biological evolution in nature.It is the randomization of its initial selection scheme and the continuous variation in genetics that makes it jump out of the dilemma of local optimization and suitable for global search and optimization.

Principle of genetic algorithm
Genetic algorithm is an algorithm based on Darwin's theory of evolution.It is suitable for solving complex problems.It has the advantages of self-learning, self-adaptation and selfoptimization.The basic principle of genetic algorithm is: it abstractly encodes the solution to the problem into chromosomes, and one chromosome corresponds to one solution.Each individual is selected and evaluated according to the fitness of the next generation by using the genetic algorithm with a higher probability of crossover and mutation, and then each individual is selected to meet the needs of the next generation, The final individual is that we want to find the optimal solution of the problem.
There are three specific steps in genetic algorithm, which are selection operation, crossover operation and mutation operation.Only by scientifically and reasonably connecting these operation steps and designing the corresponding operation scheme according to the specific problems to be solved, can the performance of the algorithm be improved to the greatest extent and the optimal solution be obtained quickly and accurately.Selection operation refers to selecting individuals with high fitness in the current population for the next step of inheritance and variation.The probability of individual selection is directly proportional to the fitness value, that is, the higher the fitness value, the greater the probability of selection; Cross operation refers to the random pairing of the parents selected in the above selection operation, so that the chromosomes of each selected individual are exchanged with a certain probability to exchange the genome corresponding to the chromosome.The crossover process is to select two chromosomes from the population and randomly select one or more chromosome positions for exchange.The general empirical value is between 0.01 and 0.99; Mutation operation refers to selecting an individual from the population and selecting one or more points in its chromosome for mutation to produce better individuals.It is an implementation means to produce new individuals.The use of mutation operator ensures the diversity of population in reproduction.It can not only further optimize the efficiency of genetic algorithm, but also force the algorithm to search the area outside the current focus, so as to avoid premature convergence.Its general empirical value is between 0.0001 and 0.1.

Characteristics of genetic algorithm
For the optimization problems with different properties in various fields, scholars have proposed different kinds of intelligent optimization algorithms, such as simulated annealing algorithm and particle swarm optimization algorithm.These algorithms are based on different theories, applicable to different specific fields, and have their own advantages and disadvantages.As an optimization algorithm suitable for solving complex problems, heritage algorithm has the following characteristics.
1) Genetic algorithm is a stochastic optimization algorithm, which has no too many mathematical requirements for the optimization problem.In view of its evolutionary characteristics, the internal attributes of the problem do not need to be considered in the search process.Whether linear or nonlinear, discrete or continuous, it can directly operate the structural object, and has a wide range of application scenarios and ranges.
2) Genetic algorithm directly takes the objective function as the search information, only uses the fitness function to evaluate the individual without other complex derivation and additional information, and carries out genetic operation on this basis to realize the information exchange between individuals in the population, so it has less dependence on solving the problem and has good flexibility.
3) Genetic algorithm adopts multi-point parallel search method, which is not limited to one point, so it can effectively prevent the search process from converging to the local optimal solution.At the same time, with the parallel settlement characteristics of genetic algorithm, we can improve the operation speed of the algorithm through large-scale parallel computing, so that fast real-time optimization is feasible.
4) Genetic algorithm operates for the coding of parameters, not for the parameters themselves.Its optimization rules depend on the corresponding probability rather than certainty.In essence, it is not only an optimization algorithm, but also provides a general framework for solving system optimization problems, which has great development 3 Adaptive optimizations of genetic algorithm

Shortcomings of genetic algorithm
Genetic algorithm simulates the biological evolution in the natural environment to achieve the global optimal solution.Although it can avoid falling into the dilemma of local optimization to a certain extent, in the face of some complex problems, genetic algorithm still has certain limitations and is difficult to accurately converge to the global optimal solution.Because the relevant parameters of the traditional genetic algorithm are fixed in the process of evolutionary optimization.Under the background of the continuous adjustment of the population with external factors, the fixed parameters can not meet the dynamic needs of individuals in different processes, which affects the performance and efficiency of the algorithm.

Adaptive genetic algorithm
The basis of seeking the global optimal solution in genetic algorithm is to preserve the excellent individuals in the population through the selection of fitness function, and the prerequisite for obtaining the excellent individuals is to ensure the diversity of individuals in the population, so as to ensure the fast convergence speed of the algorithm and effectively avoid falling into the local optimal solution.Therefore, the selection of crossover probability and mutation probability accounts for a large proportion of genetic algorithm in accurately searching the global optimal solution.Scientific and reasonable probability parameters can effectively prevent the premature phenomenon of the algorithm and improve the global search performance of genetic algorithm.In view of the above problems, this paper makes some optimization on the traditional genetic algorithm, mainly optimizing the crossover probability and mutation probability in the algorithm, and taking the fitness value of individuals in the population as an important reference index for the value of crossover and mutation probability, so as to make the algorithm closer to the actual situation of the population, so as to better screen out excellent individuals, Efficiently realize the search of global optimal solution.This paper makes the following two improvements to the genetic algorithm.1) Adaptive crossover probability.Crossover operation is the most core part of genetic algorithm, which plays the role of individual gene recombination.Through crossover operation, more excellent new individuals are continuously generated to expand the search scope of the algorithm in the whole space and ensure the excellent search performance of genetic algorithm.As the only index of crossover operation intensity, the selection of its value is very important.If the value of crossover probability is too large, the search intensity of the algorithm will further increase, but the overall efficiency of the algorithm will be affected; If the crossover probability is too small, the algorithm is likely to become slow and inefficient, and the global search performance will be greatly reduced.In order to overcome the above problems, this paper adopts an adaptive crossover probability to continuously adjust the crossover probability according to the fitness value of individuals in the group.For individuals with the largest and smallest fitness, the corresponding is not zero crossover operation or complete crossover operation, but crossover operation with specific probability, It can effectively improve the role of crossover operation in maintaining individual diversity in the algorithm.The adjusted algorithm is Where is the crossover probability, is the one with higher fitness in the first two parents of crossover operation, and are the maximum and minimum fitness in the population, , and are constants between 0 ~ 1, and .2) Adaptive mutation probability.Mutation operation is also an indispensable part of genetic algorithm.By mutating the newly generated individuals according to a certain mutation probability, we can ensure the diversity of individual genes in the population.Mutation operation is usually used in conjunction with crossover operation to improve the global search performance of the algorithm.When the algorithm is about to approach the optimal solution, appropriate mutation operation can effectively accelerate the convergence speed of the algorithm.In mutation operation, the intensity of mutation operation is expressed by mutation probability.The value of mutation probability has a significant impact on the whole algorithm.The value of mutation probability is usually small, which can prevent the loss of excellent genes in the population.If the value is too large, the algorithm tends to random search and loses its original characteristics.Relevant research shows that in unimodal function, the selection of mutation probability is generally determined according to the dimension number of individual coding string, and with the cumulative increase of iteration times, the value of mutation probability gradually decreases to improve the convergence efficiency of the algorithm.In the case of multi peak function, the adaptive mutation probability is closer to the actual problem and has a high degree of adaptability.The specific publicity is as follows: Where is the crossover probability, is the one with higher fitness in the first two parents of crossover operation, and are the maximum and minimum fitness in the population, , and are constants between 0 ~ 1, and .After the improvement of the above two aspects, the specific implementation steps of the improved genetic algorithm used in this paper are as follows: (1) Code the problem to be solved, generate the initial group, and set the number of groups and the maximum number of iterations.
(2) The fitness function is selected to evaluate the fitness of individuals in the population.
(3) Select individuals according to roulette method, enter the next step of cross operation, and roughly retain high fitness individuals.
(4) According to the adaptive crossover probability, the selected individuals are crossed.
(5) According to the adaptive mutation probability, the newly generated individual is mutated to generate a new population.
(6) Repeat 2 ~ 5 steps until the algorithm reaches a certain number of iterations or the individual fitness reaches the set standard.
(7) Output the final result and restore the coding to get the solution of the actual problem.

Simulation
Traveling salesman problem (TSP) refers to that a single traveling salesman needs to go to n cities to sell goods.It is required to start from a certain city and pass through n-1 cities.The traveling salesman can only pass through n-1 cities once and then return to the starting city, so as to minimize the journey of the traveling salesman.TSP is a classic optimization problem in operational research, which has a wide range of engineering application background, such as aircraft route planning, highway network construction, express logistics distribution, etc. these practical application problems can be transformed into TSP problems.Test in the MATLAB environment, set the number of cities as 20, and the objective function is the total path and shortest of travellers.Besides the departure city, other cities must pass through and can only pass through once.Compare the adaptive genetic algorithm in this paper with the traditional genetic algorithm with fixed crossover and mutation probability.
Through the results of MATLAB simulation, it can be found that the optimized genetic algorithm has achieved good results in convergence speed, can effectively improve the operation efficiency of the whole algorithm, and the algorithm has certain practical value.

Summary
Aiming at the shortcomings of traditional genetic algorithm, this paper adaptively improves the crossover probability and mutation probability in the algorithm to further enhance the global optimization ability of the algorithm, and verifies it by MATLAB simulation for TSP problem.The experimental data show that the optimized genetic algorithm has better convergence speed and operation efficiency.
This project is supported by the guiding project of the scientific research plan of Hubei Provincial Department of education in 2018, Project Name: Research on production scheduling problem based on Intelligent Manufacturing, Item No:B2018470