Reprint please indicate the origin: http://blog.csdn.net/tyhj_sf/article/details/53321527 principle
In order to better explain and understand the principle of genetic algorithm and the operation process, the following combined with examples of genetic algorithms to simulate the main implementation steps.
For example: Find the maximum value of the following two-do
,s∈v} is the cost metric for connections between all cities (generally the distance between cities);
If CRS = CSR, then the TSP problem is symmetric or asymmetric.
A TSP problem can be expressed as:
The solution traverses graph G = (V, E, C), all nodes at once and back to the starting node, making the path cost of connecting these nodes the lowest.
Second, genetic algorithm
1. Introduction to Genetic algorithmsGenetic algorithm, a computational model that simulates the evolution of natural selection and biological Evolution , is an algorithm that constantly chooses good individuals. When it comes to genetics, think about the nature of animal genetics, the main process of nature, including chromosome selection, crossover, mutation, a
% Percent %% Percent %%% Calculate the maximum value of the following functions %% F (x) = 10 * sin (5x) + 7 * cos (4x) x ε [0, 10] %% The value of x is expressed as a binary value in the form of a 10-bit binary value. %%% Percent %% Percent %
% Programming% -----------------------------------------------% 2.1 initialization (encoding)The % initpop. m function is used to initialize a group. popsize indicates the group size, and chromlength indicates the length of the chromosome (length of a bina
Recent exposure to genetic algorithms and the use of genetic algorithms to find the optimal solution, so the relevant contents of the collation of records.Introduction to Genetic algorithms (excerpt from Wikipedia)Genetic Algorithm (English:
Fundamentals
Genetic algorithm is a global optimization algorithm, and it is not easy to get into the local optimal point by group search technique.The basic idea: to replace the problem parameter space with the coding space, from a population that represents the potential solution set of the problem, according to the principle of survival of the fittest in the
This is the genetic algorithm.
This article attempts to introduce genetic algorithms through several concise images.
Background
When some problems do not have a deterministic optimal solution method, or the optimal solution method is 1-B for a long period of time, we have to begin to consider other ways.
For example, the traveling salesman problem:
The travel
ga--Genetic AlgorithmAs with the simulated annealing algorithm, it is one of the modern optimization algorithms. Simulated annealing still accepts a relatively poor solution at a certain degree of acceptance.Genetic algorithm, is really true and nature's genetic evolution has a very close connection, of course,
GeneticsAlgorithm(Genetic Algorithm ).
It can solve any practical problems and implement parallel computing behavior.
The operation object of the genetic algorithm is a set of feasible solutions rather than a single feasible solution. There are multiple search tracks, so it is highly feasible.
Genome coding principles
1. The genetic algorithm is used to encode the parameters for solving the problem, rather than the parameters themselves. This requires the genetic algorithm to be based on a finite alphabet, and encode the naturally generated set of optimization problems into strings of limited length. (Transf
On the detailed principles of genetic algorithms and specific definitions here is not much to introduce, want to understand the Baidu, the following is a simple introduction of their own understanding of genetic algorithms, this article on the encoding of genes using the binary rules.
Algorithm idea:Genetic algorithm
TSP problem
Algorithm
Advantages
Disadvantages
The law of poor lifting (violence)
Simple to implement
The complexity of time and space is too large to solve the problem of too many cities.
Greedy algorithm
Simple to implement and fast to calculate
It is easy to derive local optimal solution rather than global optimal solution.
Demonstration sample of manual simulation calculation of genetic algorithmTo better understand the computational process of genetic algorithms, the following manual calculations are used to simply simulate the genetic algorithmMajor operational steps.Example: To find the maximum value of the following two-tuple function: (1) Individual code the operator of th
Demonstration sample of manual simulation calculation of genetic algorithmTo better understand the computational process of genetic algorithms, the following manual calculations are used to simply simulate the genetic algorithmMajor operational steps.Example: To find the maximum value of the following two-tuple function: (1) Individual code the operator of th
and other languages may not be that big.This article will focus on how to implement genetic algorithm with Go language. If you have not participated in the Golang tour, I also suggest that you take a quick look at the language introduction.Don't say much, let's start with the code! The first example is similar to what I've done before: find a minimum value of two times.type GeneticAlgorithmSettings struct
The manual simulation of genetic algorithm is an example to better understand the genetic algorithm of the operation process, the following manual calculation to simply simulate the genetic algorithm of the main implementation ste
This article introduces C # genetic algorithm learning notes. By running a program, you will find that through continuous evolution, the overall adaptability of the population to the environment is gradually improving.
The following code implements a simple simulation process of flower evolution using the C # genetic algor
The implementation of genetic algorithm mainly contains the following 7 important questions:1. Chromosome encoding2. Group initialization3. Evaluation of Fitness value4. Select a population5. Mating of the population6. Population variation7. Algorithm FlowThe following is a brief introduction1. Chromosome encodingThe solution to solve the problem is the encoding
Genetic algorithm is a bionic algorithm, used to obtain the satisfactory solution of some problems, I feel this algorithm is very interesting, wrote this program (later hand over the big homework).
Source code: HTTP://PAN.BAIDU.COM/S/1BOSWRIF
The following copy from Baidu Encyclopedia:
This series records my learning geneticsAlgorithmFirst, declare that the MATLAB version I use is 2009b. The corresponding version of this Toolkit isVersion 2.4.2. No matter what new features or features this version has, it seems that these things are not very important to me and how to use them. Here we will introduce the version to avoid unexpected results when some friends are running this series of examples. If there are errors or unexpected results, check whether your version is 2.4.2.
Th
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.