Genetic algorithm (ZT)

Source: Internet
Author: User
Genetic algorithm

Domestic forum Http://bbs.matwav.com/post/page?bid=7&sty=1&age=20


Genetic algorithm (gnetic algorithms) is a kind of optimization algorithm based on natural selection and genetic inheritance.

Genetic algorithm (genetic algorithms) is a parallel stochastic optimization algorithm, which is based on natural selection and genetic mechanism in simulated biology.

At present, GA has achieved great success in function optimization, automatic control, image recognition, machine learning, fuselage design, artificial neural network, molecular biology, optimization and scheduling.

Since 1985, the International Conference on Genetic Algorithms has been convened, and an international association of genetic Algorithms has been set up to study the basic theories, methods and techniques of genetic algorithms, and has published papers Chiu Yu. GA has become a hot topic in international interdisciplinary. In the United States and some other Western countries in the motor and Computer science department, for undergraduates and graduate students in the theory of genetic algorithm and its application of elective courses, genetic algorithm has become an important field of artificial intelligence research, but also in order to solve difficult combinatorial optimization problems and complex function optimization problems of effective tools, and has aroused the general attention of researchers in various disciplines, they hope to adopt this new technology to solve the problems of the long-term failure to solve the problem of combinatorial optimization and complex function optimization.

At present, GA has achieved great success in function optimization, automatic control, image recognition, machine learning, fuselage design, artificial neural network, molecular biology, optimization and scheduling.

A simple introduction to the principle of genetic algorithm

In genetic algorithms, all parameters (Parameter) of an optimization problem, or a decision variable, are encoded (coding) to form a finite length string called a chromosome (chromosome) or an individual (individual). Each individual corresponds to a feasible solution to the optimization problem (feasible Solution). A group of individuals (Generation) population (Population) that describes the search space for genetic algorithms. The objective function of the optimization problem is as the environment of the population, and the objective function value is modified as the adaptive degree of the individual to the environment (Fitness). In search, a number of encoded ancestors were randomly generated to form the most primitive population. Starting from these populations, simulating the evolutionary process, using the principle of survival of the fittest, first decoding the individual (decoding), restoring the encoded parameters to the actual parameters, and then using the objective function to calculate the suitability of the population, and then by selecting (Selection) the individual with high suitability to form a new population, Finally, the good properties of these new populations can be inherited and retained to the next generation by means of exchange (Crossover) and mutation (Mutation). So the "choice-exchange-mutation-choice" is repeated, so that the good gene components of each generation accumulate gradually, and the average fitness and optimal individual suitability of the population increase, until the iterative process tends to converge.

Iii. advantages and disadvantages of genetic algorithm

Compared with other optimization algorithms, genetic algorithms have the following advantages:

(1). The search process acts on the encoded string and does not directly affect the specific variables of the optimization problem, and the search uses random transformation rules rather than established rules. It uses heuristic search instead of blind exhaustive search, and thus has a higher search efficiency.

(2). Most of the current optimization algorithms are based on the requirements of linearity, convexity and differentiable, and genetic algorithm only needs the information of suitability, does not need the derivative and other auxiliary information, the dependence on the problem is small, so it has high nonlinearity and wide applicability. In addition, a common algorithm can be written to solve many different optimization problems.

(3). Genetic algorithms start searching from a set of initial points, rather than starting from a single initial point. And given a group of excellent solutions, rather than an optimization solution, which gives designers a greater choice. It can search fully in the solution space and has the ability of global optimization.

(4). Genetic algorithm is very easy to modify. Even if there are minor changes to the original problem (such as the improvement of the objective function), most of the existing algorithms may be completely out of use, and genetic algorithms can be adapted to new problems with little modification.

(5). Genetic algorithm has strong parallelism, it can improve the computation speed by parallel computation, so it is more suitable for the optimization of large-scale complex problems.

Based on the above advantages, genetic algorithm is attractive to the optimization workers.

However, because genetic algorithm is a new algorithm, in practice, there are still many places to further deepen and improve, mainly focus on the following aspects:

(1). The theoretical research of genetic algorithm lags behind. The genetic algorithm is also a kind of bionic thought, although the practice effect is very good, but the theory proved to be more difficult. Moreover, the time of this algorithm is not very long, so the research of theory and practice is almost parallel.

(2) The GA algorithm itself lacks the quantitative standard, and the current experience value is used, and different coding and different genetic techniques will affect the selection of genetic parameters, thus affecting the generality of the algorithm.

(3). GA has no effective means to deal with the constraint problem, the traditional penalty function method is a difficult technical problem to select the penalty factor.

The main vector of biological genetic material is chromosomes, in genetic algorithms, chromosomes are usually a series of data (or arrays), used as the solution to the optimization problem of the code, which is not necessarily the solution. Genetic algorithms typically undergo several processes: first, a random number of random chromosomes are produced, and these randomly produced chromosomes form a population. The number of chromosomes in a population is called population size or population size. The evaluation function is then used to evaluate the advantages and disadvantages of each chromosome, that is, the degree of adaptation of the chromosome to the environment (called Fitness), which is used as a basis for later heredity. Then the selection process, the purpose is to select from the current population of good chromosomes, so that they are called a new generation of chromosomes, the criteria for determining whether a good chromosome is the degree of fitness, that is, the higher the degree of chromosome adaptation, the more opportunities they are chosen. By selecting a process, a new population is produced. Cross operation of this new population is one of the main genetic operations in genetic algorithm. Then, the mutation operation is to excavate the diversity of the individual in the population and overcome the malady that may fall into the local solution. Thus, the chromosomes produced by the above operations are called offspring. Then, the selection, crossover and mutation of the new population (i.e. progeny) are repeated, and the optimal solution of the best chromosome is optimized after a given number of iterations.

Presentation structure

There are two ways to represent the solution of the optimization problem: binary vector and floating-point vector. Using binary vectors as a chromosome to represent the true value of a decision variable, the length of a vector depends on the required precision, and the need to use binary code has been criticized. In solving complex optimization problems, the binary vector representation structure is sometimes not convenient.

Another method of representation is a floating-point vector, each of which is represented by a floating-point vector with the same length as the solution vector. Here the solution of the optimization problem is represented by x = (x1,x2,..., xn), where n is the dimension, and the corresponding chromosome is also V = (x1,x2,..., xn).

Handling constraints

The key to dealing with constraints is (a) to delete all the equations in the constraint, (b) to design appropriate genetic operations to ensure that all newly created chromosomes are in a feasible concentration.

Initialization process

evaluation function

The evaluation function (expressed in eval (V)) is used to set a probability for each dye V in the population, so that the likelihood of the chromosome being selected is proportional to the adaptability of the other chromosomes in the population, that is, by means of roulette, the adaptable chromosome is more likely to be chosen to produce offspring.

The first method, where the current chromosome v1,v2,..., Vn, can be reproduced according to the order of the chromosome rather than the actual target value. No matter what mathematical programming (single goal, multiobjective or goal planning) can make a reasonable assumption that in chromosome v1,v2,..., Vn, decision-makers can give a sequence of relations, so that the chromosome from good to bad rearrangement, that is, the better a chromosome body, the smaller the number. Set the parameters and define the order based evaluation function as:

, i = 1,2,..., n

i = 1 means the chromosome is best, I = n indicates the chromosome is the worst.

The second method is to design the evaluation function by the appropriate scaling adjustment (called the Fitness calibration) for the fitness degree. F1,f2,..., FN (i.e. chromosome v1,v2,..., Vn their target values) to indicate the original fitness. Goldberg〖1〗 a linear fitness scaling scheme is proposed:

, i = 1,2,..., n

Which is the new fitness, A and B are parameters. This method assumes that the user understands the nature of the objective function, so that reasonable parameters A and B can be designed. In this case, the evaluation function is defined as:

, i = 1,2,..., n

Selection process

The selection process is based on rotation roulette n times. Each rotation selects a chromosome for the new population. The roulette wheel chooses chromosomes according to the fitness of each chromosome. Regardless of which evaluation function is used, the selection function can always be written in the following form:

Step 1 for each chromosome Vi, calculate the cumulative probability of Qi

Step 2 produces a random number r from the interval [0,QN];

Step 3 If, then select the first chromosome Vi, (1≤i≤n);

Step 4 Repeat steps 2 and 3 for a total of n times, so that you can get n copied chromosomes.

In practice, Qi,i = 1,2,..., n divided by Qn can be used to make qn=1, and the new probability is proportional to the degree of adaptability.

Cross operation

First, the probability of the Pc being a crossover operation is defined, which indicates that the expected value in the population is PC n Chromosomes for cross operation. To determine the parent of a cross operation, repeat the following from i = 1 to n: Generate a random number from [0,1] R, if R < Pc, select Vi as a parent.

Use,..., to represent the parent selected above and randomly divide them into the following pairs of

,,,... ,

Each pair is then interleaved, for example, by first generating a random number C between (0,1), and then by intersecting between the following forms, resulting in two descendants X and Y

,

If the feasible set is convex, the convex combination crossover operation ensures that two offspring are feasible; If the feasible set is not a convex set or difficult to verify, then need to test the x,y, if not meet the constraints, you need to recreate the C value, repeat the above crossover operation.

Mutation operation

13 defines the probability of a Pm as a crossover operation, and this probability indicates that the expected value in the population is PM n Chromosomes for cross operation.

Like crossover, you first select the parent that needs to be mutated, and then mutate the following methods for each parent (expressed in V) that requires mutation. Randomly selecting the mutation direction D in Rn, taking M as a number large enough, if V+m D is not feasible, then set M to a random number between 0 and m until it is feasible.

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.