Getting Started with genetic algorithm - 4 serial

Four serial

Evolution genetic algorithms, a few technical terms


3.3 in the computer evolution

(Evolution Inside Your Computer)

... The process is essentially the work of genetic algorithms is to simulate the evolution of organisms. First, to provide for a coding method, a potential that any feasible solution to your problems can be expressed as a "digital" chromosomes. Then, create a random initial population of chromosomes (each chromosome represents a different candidate solutions), and in a period of time in order to foster the most adaptable individual approach, so that they evolve during this period, certain locations on the chromosome to add a small amount of variation. After many generations, a little better luck, genetic algorithm will converge to a solution. Genetic algorithms are not guaranteed to get the solution, it is the best solution if not guaranteed to find solvable, but as long as the methods used correctly, you can usually genetic algorithms to compile a program that can run well. The biggest advantage of genetic algorithm is that you do not need to know how to solve a problem; you need to know is just, viable solution how to encode a way that it can be used by the genetic algorithm mechanism.

... In general, the representative of the chromosome feasible solutions using a series of bits as the encoding. In the beginning of the run, you create a group of chromosomes, each chromosome is a random set of binary bits. Binary bits (i.e., chromosomal) in length are the same throughout the population. As an example, the length of the chromosome 20 form as follows:

.........................01010010100101001111

.... The important thing is that each chromosome are encoded in such a way to a string of 0's and 1's, and they are by decoding can be used to represent a solution to your problem at hand. This may be a poor solution, it could be a very perfect solution, but each individual chromosome represents a feasible solution (will be discussed below in more detail about the encoding). The initial groups are usually bad, a bit like the English cricket team or the United States soccer team (sorry!). Anyway, as I said before, an initial group has been created (for this example, we may assume a total of 100 members), so that you can begin to do a series of work listed below (you do not fear with those words in bold, I will come back soon explain everything):

The following continuous loop until a solution to find out:

1. Check each chromosome, to see how it solves the problem of performance, and allocate a fraction of its adaptability.

2. elect two members from the current population. Probability of being selected is proportional to the adaptability of the chromosome, the higher the suitability score, the greater the possibility of being picked. Conventional approach is to use a so-called roulette wheel selection process (Roulette wheel selection).

3. In accordance with a preset rate of hybridization (Crossover Rate), hybridization (Crossover) from each selected on a random chromosome points.

4. The predetermined variation rate (mutation rate), by the circulation of the selected chromosome bit, the corresponding bit flipping implement (flip).

5. Repeat steps 2, 3, 100 members until the new group being created.

End of the cycle


..... In the above algorithm Step 1 to Step 5 the first cycle is called a generation (or generation, generation). And I put the whole cycle is called an era (epoch), in my body and in the code is always in such a way to call.

3.3.1 What is the roulette wheel selection?
(What's the Roulette Wheel Selection)

. . Roulette wheel selection is to choose some members of the chromosome from human population, the probability of being selected and their adaptive fractional proportional to the chromosome adaptability higher score, the more probability of being selected also. This does not guarantee the suitability of the highest scores will be able to choose the members of the next generation, only that it has the greatest probability of being selected. The working process is as follows:

. . Appropriateness scores of all members of the group envisaged a pie chart to represent (see Figure 3.4), and the runner on the pie shape for gambling same. We want to specify each chromosome in a small piece of the pie for the group. The block size and the adaptive fractional proportional chromosome, adaptive fractional higher, which corresponds to the small area occupied by the pie chart are greater. To select a chromosome, you need to do is rotate the wheel and put a ball thrown into which it turn to turn to beat, until wheel stop, watch the ball stop on which one, you select and that it corresponds to the chromosome. Later in this chapter I'll tell you how to write accurate algorithm such procedures.

Figure 3.4 roulette bet type selected chromosomes

3.3.2 What is a hybrid rate? (What's the Crossover Rate)

. . Hybridization rate is used to determine the two chromosomes exchange local bit (bit) to generate the probability of two new offspring. Experiments show that this value is usually taken to be around 0.7 is ideal, although some problem areas may need to be higher or lower number of values.

. . Each time, we selected from the group of chromosome 2, while generating a random number value between 0 and 1, and then to determine whether two chromosomes were hybridized according to the value of this data. If the value is less than the rate of hybridization (O.7) hybridization proceeds, then you will randomly select a location along the length of the chromosome, and all bit positions behind this exchange.

For example, a given set of two chromosomes:

.........................10001001110010010

.........................01010001001000011

. . You randomly select a position along their length, for example 10, then swap all bits after the first 10 bits. In this way it becomes a two chromosomes (I have added a space at the beginning of the swap position):

.........................100010011 01000011

.........................010100010 10010010

3.3.3 What is the mutation rate? (What's the Mutation Rate?)

. . Mutation rate (mutation rate)is implemented in an inverted position in the chromosome (flip, i.e. 0 becomes 0 becomes 1,1) probability. This is usually a very low value for binary-encoded gene is, for example 0.001.

. . Therefore, no matter how you choose to chromosome from the population, you should first check whether hybrids, from start to finish and then check each bit offspring chromosome, as defined in accordance chance for some position in which the implementation of mutations (flip).

3.3.4 loud noise out of it?! (Phew!)

. . If you say something on top feel a bit at a loss, then do not worry! From now until the end of this chapter, most of all reading materials are designed to re-read it twice. There are many new concepts you need to understand, and they are all mixed together. I believe that for you this is the best way to learn. When you read through the first pass, you are expected to get some basic concepts isolated perceptions, and in reading the second time (if my work is done correctly), you can see how a variety of different concepts linked to each other. And when you finally begin to combine source programming play, every thing is just to be careful consideration of how to arrange the issue, until then your job is just a how to refine your knowledge and skills to do the ( it was part of easier).

Note
. . In Chaper3 / Pathfinder book accompanying CD-ROM file folder, you can find all the source code Pathfinder project.

. . If you want to peek at the whole picture of the project before further reading of the text, there is a pre-fabricated Chaper3 / Executable file good execution of the program, Pathfinder.exe.

. . (Chapters of the book all the source code and execute programs stored in the CD-ROM in the same way the relevant folder)

Reproduced in: https: //my.oschina.net/dake/blog/196703

Guess you like

Origin blog.csdn.net/weixin_33825683/article/details/91508507