遗传算法 退火算法
We hear about genetic algorithm every now and then but what exactly is this genetic algorithm? And why does it sound so much related to the subject of biology? Does it really use genes or some other biological entity while it is being implemented or the processes it involves are similar to what happens in biology? These are some of the questions even I had when I first heard about the term genetic algorithm in my graduation days. If you are like what I was back then and want to figure out within minutes what this so-called genetic algorithm or GA is then this is the right place to start your journey. This article is specially written for those who are new to the concept of algorithms and want to get a good grasp of the concept of genetic algorithm in computer science.
我们时不时听到遗传算法 ,但是这个遗传算法到底是什么? 为什么听起来与生物学主题如此之相关? 它在实施过程中是否真的使用基因或其他生物实体,或者它所涉及的过程与生物学中发生的事情类似? 这些甚至是我毕业时第一次听说遗传算法一词时遇到的问题。 如果您像我当时的样子,并且想在几分钟之内弄清楚这种所谓的遗传算法或遗传算法是什么,那么这就是开始您的旅程的正确地方。 本文专为那些对算法概念不熟悉并希望掌握计算机科学中的遗传算法概念的读者而写。
什么是遗传算法? (What is a Genetic Algorithm?)
Genetic Algorithm (GA) is a search-based optimization technique that follows the principle of Genetics and Natural Selection in the field of Biology. The main purpose of this algorithm is to find optimal or near-optimal solutions to quite a few difficult of difficult problems which are probably unsolvable or would take a very long time to solve using normal procedures or algorithms. Genetic Algorithm is quite often used to solve optimization problems in machine learning and to generate high-quality solutions for optimization problems.
遗传算法(GA)是一种基于搜索的优化技术,遵循生物学领域的遗传和自然选择原理。 该算法的主要目的是找到相当多的困难问题的最优或接近最优的解决方案,这些问题可能无法解决,或者使用常规过程或算法需要很长时间才能解决。 遗传算法通常用于解决机器学习中的优化问题并为优化问题生成高质量的解决方案。
The concept of GA has been adopted from the natural genetic evolution and thereby again proving the point that
遗传算法的概念已从自然遗传进化中被采纳,从而再次证明了这一点:
“Nature has always been a great source of inspiration to all mankind.”
“自然一直是全人类灵感的重要来源。”
It is a subset of a much larger branch of computation, known as the Evolutionary Computation. Genetic Algorithms were developed by John H. Holland and his students and colleagues at the University of Michigan, of which David E. Goldberg is the most notable.
它是更大的计算分支(称为进化计算 )的子集。 遗传算法是由密歇根大学的 John H. Holland和他的学生和同事开发的,其中最著名的是David E. Goldberg 。
In short, the genetic algorithm repeatedly modifies a population of individual solutions. At each step, the genetic algorithm selects individuals at random from the current population to be parents and uses them to produce the children for the next generation. Over successive generations, the population “evolves” toward an optimal solution.
简而言之,遗传算法会反复修改单个解决方案的总体 。 在每个步骤中,遗传算法都会从当前人口中随机选择一个个体作为父母,并使用它们为下一代生产子代。 在连续的世代中,总体“朝着最佳解决方案发展”。
The genetic algorithm uses three main types of rules at each step to create the next generation from the current population:
遗传算法在每个步骤中使用三种主要类型的规则来从当前种群中创建下一代:
Selection rules select the individuals, called parents, that contribute to the population at the next generation.
选择规则选择称为下一代的个体,这些个体为下一代做出了贡献。
Crossover rules combine two parents to form children for the next generation.
交叉规则将两个父母结合在一起,形成下一代的孩子。
Mutation rules apply random changes to individual parents to form children. [1]
突变规则将随机变化应用于单个父母以形成孩子。 [1]
![Image for post](https://i-blog.csdnimg.cn/blog_migrate/4cacfcda0e68e661cf05eac303edc78d.png)
经典算法与遗传算法的区别 (Difference between Classical Algorithm and Genetic Algorithm)
A classical algorithm generates a single point after each iteration, and a sequence of those points approaches an optimal solution. Whereas on the other hand, a GA generates a population of points after each iteration and the best point in the population approaches the optimal solution.
经典算法在每次迭代后都会生成一个点,并且这些点的序列会接近最优解。 另一方面,GA在每次迭代后都会生成一组点,并且该点中的最佳点接近最优解。
A classical algorithm selects the next point in the sequence by a deterministic approach but a genetic algorithm selects the next population by in a random fashion using a random number generator.
经典算法通过确定性方法选择序列中的下一个点,而遗传算法使用随机数生成器以随机方式选择下一个总体。
一些重要的术语 (A few important terminologies)
搜索空间: (Search Space:)
Search Space is basically where all the individuals or data points in a population are stored and maintained. Each of these individuals represents one solution in the search space for a given problem. Each one of these is an array or a vector of components and is analogous to a chromosome i.e., it can be thought of as a single chromosome inside a nucleus. The variable components inside a chromosome can be thought of as genes i.e., a chromosome consists of several genes.
搜索空间基本上是存储和维护总体中所有个人或数据点的地方。 这些个体中的每一个都代表给定问题在搜索空间中的一种解决方案。 这些中的每一个都是成分的阵列或载体 ,并且类似于染色体,即可以认为是核内的单个染色体。 染色体内部的可变成分可以被认为是基因,即染色体由几个基因组成。
健身得分: (Fitness Score:)
There is always a fitness score that is given to each individual or data point. The individuals with the best or better to say ‘the optimal’ score, are taken into consideration and given a higher priority to reproduce new generations. These individuals with better fitness scores are selected for mating and they produce better offspring by combining the chromosomes of the parents. While implementing the algorithm, we can take a population size to be fixed or static. Higher population sizes give rise to better offspring in lesser iterations and it is hoped that with successive iterations or generations better solutions are achieved. It is considered that the population has converged and has reached the optimal solution if there is no more significant difference between the new offspring and the offspring produced by the previous generations. Therefore, the algorithm is said to have converged to a set of solutions for the given problem.
始终为每个个人或数据点都提供适合度评分。 具有最佳或更好的“最佳”分数的个人将被考虑在内,并被赋予更高的优先权来繁殖新一代。 选择这些具有较高健身得分的个体进行交配,并通过结合父母的染色体产生更好的后代 。 在实施算法时,我们可以将人口规模设为固定或静态。 较高的种群数量会在较少的迭代中产生更好的后代,并希望通过连续的迭代或后代获得更好的解决方案。 如果新的后代与前代产生的后代之间没有更大的差异,则认为种群已经收敛并达到了最佳解。 因此,据说该算法已收敛到给定问题的一组解决方案。
操作方式: (Operations:)
Selection: This is an operation where the individuals with a better fitness score are given preference and allowed to pass their genes to the successive generations. Therefore, individuals with better fitness scores are allowed to mate and produce offspring for the next successive generation.
选择:这是一项适合性得分较高的个体得到优先选择并允许其基因传给后代的操作。 因此,身体素质得分较高的个体被允许交配并为后代繁殖后代。
Crossover: This is an operation where the actual (analogous) mating takes place between individuals. The crossover sites or locations in a chromosome are chosen in this operation and the two selected chromosomes from the selection operation are taken for crossover. The actual crossover happens when the genes, which were chosen are taken and combined to produce the new offspring (which is of the same length as that of the parents.) Please note all the selection of crossover points is done at random. The following example will make it clearer.
交叉:这是一个实际的(类似)交配发生在个体之间的操作。 在该操作中选择染色体中的交叉位点或位置,并从选择操作中选择两个选定的染色体进行交叉。 当选择的基因被合并并产生新的后代(与亲本的长度相同)时,就会发生实际的交叉。请注意,所有交叉点的选择都是随机进行的。 以下示例将使其更加清晰。
![Image for post](https://miro.medium.com/max/9999/1*dROsiou60vCG6Utjn0YqEw.png)
Mutation: This is an operation where some individual genes are taken from an offspring and mutated or changed. It’s better to use the word ‘insert’ rather than ‘change’. This is primarily done to maintain diversity in the population and also to avoid any premature convergence of the algorithm which we don’t want. We want the algorithm to take its own time to give us the optimal solution. Please note here also the mutating locations are chosen at random. Here’s an example to make things clear.
突变:此操作是从后代中获取某些单个基因并进行突变或更改。 最好使用“插入”一词,而不要使用“更改”。 这样做主要是为了保持总体的多样性 ,并且还避免了我们不需要的算法的任何过早收敛。 我们希望该算法花费自己的时间为我们提供最佳解决方案。 请注意,这里的变异位置也是随机选择的。 这是一个使事情变得清楚的例子。
![Image for post](https://i-blog.csdnimg.cn/blog_migrate/762f431b6a8a13fcf68ee5f0408df907.png)
遗传算法的优缺点 (Advantages and Disadvantages of Genetic Algorithm)
There are many advantages of genetic algorithms over traditional optimization algorithms. Two of the most notable are, the ability to deal with complex problems and parallelism. Genetic algorithms can deal with various types of optimization, whether the objective (fitness) function is stationary or nonstationary (changes with time), linear or nonlinear, continuous or discontinuous, or with random noise. Because multiple offspring in a population act like independent agents, the population (or any subgroup) can explore the search space in many directions simultaneously. This feature makes it ideal to parallelize the algorithms for implementation. Different parameters and even different groups of encoded strings can be manipulated at the same time. [2]
与传统的优化算法相比,遗传算法有许多优点。 最值得注意的两个是处理复杂问题和并行性的能力。 遗传算法可以处理各种类型的优化,无论目标(适应性)函数是平稳的还是非平稳的(随时间变化),线性或非线性,连续或不连续,还是随机噪声。 由于种群中的多个后代充当独立的代理,因此种群(或任何亚组)可以同时在多个方向上探索搜索空间。 此功能非常适合并行化实现算法。 可以同时操纵不同的参数,甚至不同的编码字符串组。 [2]
However, genetic algorithms also have some disadvantages. The formulation of a fitness function, the use of population size, the choice of important parameters such as the rate of mutation and crossover, and the selection criteria of the new population should be carried out carefully. Any inappropriate choice will make it difficult for the algorithm to converge or it will simply produce meaningless results. Despite these drawbacks, genetic algorithms remain one of the most widely used optimization algorithms in modern nonlinear optimization. [2]
但是,遗传算法也有一些缺点。 适应性函数的公式化,人口规模的使用,重要参数的选择(例如突变率和交叉率)以及新人口的选择标准应谨慎执行。 任何不适当的选择都会使算法难以收敛,或者只会产生毫无意义的结果。 尽管有这些缺点,遗传算法仍然是现代非线性优化中使用最广泛的优化算法之一。 [2]
其他优点包括: (Further advantages include:)
Genetic Algorithms has the ability to optimize continuous and discrete functions and also multi-objective problems like route mapping (dependant on distance, time, traffic, etc.)
- It always generates a solution and also the one that improves with time or successive iterations. 它总是产生一种解决方案,并且随着时间的推移或连续的迭代不断改进。
- This algorithm is quite useful and produces better results when the search space or population of individuals is very large and has a large number of parameters. 当搜索空间或个人人口很大并且具有大量参数时,该算法非常有用,并且会产生更好的结果。
- It is basically faster than classical algorithms and more efficient. 它基本上比经典算法更快,并且效率更高。
缺点包括: (Disadvantages include:)
The greatest disadvantage could be that since GA is stochastic in nature, there is no guarantee on the optimality or quality of the solution. Many times it may not reach the desired solution.
最大的缺点可能是,由于GA本质上是随机的,因此无法保证解决方案的最优性或质量。 很多时候,它可能无法达到所需的解决方案。
- If the GA is not implemented correctly, then we might fail to reach the optimal solution i.e., the algorithm may not converge. 如果GA实施不正确,那么我们可能无法达到最佳解决方案,即算法可能无法收敛。
The very fact that fitness value is calculated for every successive generation may increase computational complexity for some problems.
为每个连续的世代计算适应度值的事实可能会增加某些问题的计算复杂性 。
伪码 (Pseudocode)
Here’s a sketch of a typical GA in pseudocode:
这是伪代码中典型GA的示意图:
GA()
begin
Create initial population;
while (Until Stopping Criteria)
for (Each Chromosome)
Calculate fitness value;
Selection (Survival of strong individuals);
Crossover (Here, new generation produced);
Mutation (Changing some genes for new and
different individuals);
end
Generate new population;
end
end
我们现在可以深入研究代码了吗? (Can we now dive into the code?)
The following is a simple example python program where the genetic algorithm has been implemented. The code has been taken from GeeksforGeeks and therefore in no manner do I claim the ownership of the following code. I will try my best to explain the code step by step.
以下是一个简单的示例python程序示例,其中已实现了遗传算法。 该代码取自GeeksforGeeks ,因此,我绝不主张以下代码的所有权。 我将尽力逐步解释代码。
# Python3 program to create target string, starting from
# random string using Genetic Algorithm
import random
# Number of individuals in each generation
POPULATION_SIZE = 100
# Valid genes
GENES = '''abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP
QRSTUVWXYZ 1234567890, .-;:_!"#%&/()=?@${[]}'''
# Target string to be generated
TARGET = "I love GeeksforGeeks"
This portion is mainly importing the random library in Python, setting a population size, setting the valid genes, and the target string.
这部分主要是在Python中导入随机库,设置种群大小,设置有效基因和目标字符串。
class Individual(object):
'''
Class representing individual in population
'''
def __init__(self, chromosome):
self.chromosome = chromosome
self.fitness = self.cal_fitness()
This is where the class Individual definition starts and it defines, two-member variables chromosome and fitness, and initializes them.
这是类Individual定义的起点,它定义了两个成员变量染色体和适应度 ,并将其初始化。
@classmethod
def mutated_genes(self):
'''
create random genes for mutation
'''
global GENES
gene = random.choice(GENES)
return gene
mutated_genes() is a function where the mutation in the genes takes place. Here, a random gene is taken from the pool of the genes and is returned to the main program.
mutated_genes()是一个函数,其中基因发生突变。 在这里,从基因库中提取一个随机基因,并返回到主程序。
@classmethod
def create_gnome(self):
'''
create chromosome or string of genes
'''
global TARGET
gnome_len = len(TARGET)
return [self.mutated_genes() for _ in range(gnome_len)]
create_gnome() creates individual gnomes or chromosomes of target length and returns to the main function.
create_gnome()创建目标长度的单个侏儒或染色体,并返回到主函数。
def mate(self, par2):
'''
Perform mating and produce new offspring
'''
# chromosome for offspring
child_chromosome = []
for gp1, gp2 in zip(self.chromosome, par2.chromosome):
# random probability
prob = random.random()
# if prob is less than 0.45, insert gene
# from parent 1
if prob < 0.45:
child_chromosome.append(gp1)
# if prob is between 0.45 and 0.90, insert
# gene from parent 2
elif prob < 0.90:
child_chromosome.append(gp2)
# otherwise insert random gene(mutate),
# for maintaining diversity
else:
child_chromosome.append(self.mutated_genes())
# create new Individual(offspring) using
# generated chromosome for offspring
return Individual(child_chromosome)
mate() is a very important function as here is exactly where the new chromosomes with better fitness are created. Two operations that occur here are crossover and mutation. This is actually a modified or custom genetic algorithm where the operations are based on random probability. If the probability is less than 0.45 then a gene from parent chromosome 1 is passed on to the child chromosome whereas if the probability is greater than or equal to 0.45 and less than 0.90 then the corresponding gene from parent chromosome 2 is passed on to the child chromosome and if the probability is more than or equal to 0.90 then mutated gene is passed on to the child chromosome and finally the new chromosome is returned.
mate()是一个非常重要的函数,因为正是在这里创建了具有更好适应性的新染色体。 这里发生的两个操作是交叉和变异 。 这实际上是一种修改或自定义的遗传算法,其中的操作基于随机概率。 如果概率小于0.45,则将来自父染色体1的基因传递给子染色体,而如果概率大于或等于0.45且小于0.90,则将来自父染色体2的相应基因传递给子 染色体。 染色体和其发生的概率大于或等于0.90,然后突变基因传给孩子的染色体 ,最后返回新的染色体 。
def cal_fitness(self):
'''
Calculate fittness score, it is the number of
characters in string which differ from target
string.
'''
global TARGET
fitness = 0
for gs, gt in zip(self.chromosome, TARGET):
if gs != gt: fitness+= 1
return fitness
cal_fitness() calculates the fitness score of a particular chromosome and returns it that the genetic algorithm can take decisions accordingly. This particular function checks if the target string has been achieved or not and accordingly creates the fitness score based on the number of characters that are yet to meet the target requirement.
cal_fitness()计算特定染色体的适合度得分 ,并将其返回给遗传算法可以据此做出决策。 该特定功能检查是否已达到目标字符串,并根据尚未满足目标要求的字符数创建适应度得分。
# Driver code
def main():
global POPULATION_SIZE
#current generation
generation = 1
found = False
population = []
# create initial population
for _ in range(POPULATION_SIZE):
gnome = Individual.create_gnome()
population.append(Individual(gnome))
while not found:
# sort the population in increasing order of fitness score
population = sorted(population, key = lambda x:x.fitness)
# if the individual having lowest fitness score ie.
# 0 then we know that we have reached to the target
# and break the loop
if population[0].fitness <= 0:
found = True
break
# Otherwise generate new offsprings for new generation
new_generation = []
# Perform Elitism, that mean 10% of fittest population
# goes to the next generation
s = int((10*POPULATION_SIZE)/100)
new_generation.extend(population[:s])
# From 50% of fittest population, Individuals
# will mate to produce offspring
s = int((90*POPULATION_SIZE)/100)
for _ in range(s):
parent1 = random.choice(population[:50])
parent2 = random.choice(population[:50])
child = parent1.mate(parent2)
new_generation.append(child)
population = new_generation
print("Generation: {}\tString: {}\tFitness: {}".format(generation, "".join(population[0].chromosome), population[0].fitness))
generation += 1
print("Generation: {}\tString: {}\tFitness: {}".format(generation, "".join(population[0].chromosome), population[0].fitness))
if __name__ == '__main__':
main()
This is the main algorithm function where all the previous functions are called to do their individual works. First, the initial population is created. Then, the population is sorted according to its fitness score putting the best-scored chromosomes at the beginning. Now it checks if the first (best fitness score) has a fitness score less than or equal to 0 then it shall return the string as that is the target string and the algorithm stops. If not, it performs elitism by adding 10% of the fittest population into the next generation population and further 50% of the old population goes into mating to produce children. Now the new generation is worked with again from the beginning passing through all the above steps. Ultimately, we see that after a considerable amount of execution time, the algorithm stops and produces the target string.
这是主要的算法功能,以前的所有功能均被调用以完成各自的工作。 首先, 创建初始种群 。 然后, 根据适应度得分对种群进行排序,将得分最高的染色体放在开始位置。 现在,它检查第一个(最佳适应性得分)是否具有小于或等于0的适应性得分,然后它将返回字符串,因为该字符串是目标字符串,并且算法停止。 如果不是这样,它通过将10%的最适龄人口添加到下一代人口中来进行精英化 ,而另外50%的老龄人口进行交配来生育孩子。 现在,通过以上所有步骤,从头开始重新使用新一代产品。 最终,我们看到经过相当长的执行时间后,该算法停止运行并生成目标字符串 。
This is the output I received:
这是我收到的输出:
PS C:\Users\RAJARSI> & python c:/Users/RAJARSI/Desktop/GA.py
Generation: 1 String: i a2yl [TXl Xn[:rZnL Fitness: 18
Generation: 2 String: U[vW 5 mL&TgW rdLeVY Fitness: 17
Generation: 3 String: 4g9W/5 mO&["W rGLefY Fitness: 16
Generation: 4 String: 4gCa/5 G];[4Wo;G3e}Y Fitness: 15
Generation: 5 String: 4gCa/5 G];[4Wo;G3e}Y Fitness: 15
Generation: 6 String: F 1! e GeWk@/bal#tk2 Fitness: 13
Generation: 7 String: F 9! e Ge k@#OtG#e}9 Fitness: 12
Generation: 8 String: F 9! e Ge k@#OtG#e}9 Fitness: 12
Generation: 9 String: { C0Xh GeePv=orG3ePY Fitness: 11
Generation: 10 String: 5y6/;e Gee3nWorG3ekY Fitness: 10
Generation: 11 String: 5y6/;e Gee3nWorG3ekY Fitness: 10
Generation: 12 String: I 1WPe GeekD=oZG_e}Y Fitness: 9
Generation: 13 String: I 1WPe GeekD=oZG_e}Y Fitness: 9
Generation: 14 String: I 1WPe GeekD=oZG_e}Y Fitness: 9
Generation: 15 String: I ( W GeeknaorG3ekY Fitness: 8
Generation: 16 String: I ( W GeeknaorG3ekY Fitness: 8
Generation: 17 String: I }!pe Geek"QorGPekY Fitness: 7
Generation: 18 String: I }!pe Geek"QorGPekY Fitness: 7
Generation: 19 String: I }!pe Geek"QorGPekY Fitness: 7
Generation: 20 String: F Oo&e Geekn5orGeekY Fitness: 6
Generation: 21 String: F Oo&e Geekn5orGeekY Fitness: 6
Generation: 22 String: F Oo&e Geekn5orGeekY Fitness: 6
Generation: 23 String: F Oo&e Geekn5orGeekY Fitness: 6
Generation: 24 String: I loOe Geev"5orGeekY Fitness: 5
Generation: 25 String: I loOe Geev"5orGeekY Fitness: 5
Generation: 26 String: I goOe GeekJYorGeeks Fitness: 4
Generation: 27 String: I goOe GeekJYorGeeks Fitness: 4
Generation: 28 String: I goOe GeekJYorGeeks Fitness: 4
Generation: 29 String: I goOe GeekJYorGeeks Fitness: 4
Generation: 30 String: I goOe GeekJYorGeeks Fitness: 4
Generation: 31 String: I goOe GeekJYorGeeks Fitness: 4
Generation: 32 String: I goOe GeekJYorGeeks Fitness: 4
Generation: 33 String: I goOe GeekJYorGeeks Fitness: 4
Generation: 34 String: I goOe GeekJYorGeeks Fitness: 4
Generation: 35 String: I lo e GeekJQorGeeks Fitness: 3
Generation: 36 String: I lo e GeekJQorGeeks Fitness: 3
Generation: 37 String: I love Geek"farGeeks Fitness: 2
Generation: 38 String: I love Geek"farGeeks Fitness: 2
Generation: 39 String: I love Geek"farGeeks Fitness: 2
Generation: 40 String: I love Geek"farGeeks Fitness: 2
Generation: 41 String: I love Geek"farGeeks Fitness: 2
Generation: 42 String: I love Geek"farGeeks Fitness: 2
Generation: 43 String: I love Geek"farGeeks Fitness: 2
Generation: 44 String: I love Geek"farGeeks Fitness: 2
Generation: 45 String: I love Geek"farGeeks Fitness: 2
Generation: 46 String: I love Geek"farGeeks Fitness: 2
Generation: 47 String: I love GeekEforGeeks Fitness: 1
Generation: 48 String: I love GeekEforGeeks Fitness: 1
Generation: 49 String: I love GeekEforGeeks Fitness: 1
Generation: 50 String: I love GeekEforGeeks Fitness: 1
Generation: 51 String: I love GeekEforGeeks Fitness: 1
Generation: 52 String: I love GeekEforGeeks Fitness: 1
Generation: 53 String: I love GeekEforGeeks Fitness: 1
Generation: 54 String: I love GeekEforGeeks Fitness: 1
Generation: 55 String: I love GeekEforGeeks Fitness: 1
Generation: 56 String: I love GeekEforGeeks Fitness: 1
Generation: 57 String: I love GeekEforGeeks Fitness: 1
Generation: 58 String: I love GeekEforGeeks Fitness: 1
Generation: 59 String: I love GeekEforGeeks Fitness: 1
Generation: 60 String: I love GeekEforGeeks Fitness: 1
Generation: 61 String: I love GeekEforGeeks Fitness: 1
Generation: 62 String: I love GeekEforGeeks Fitness: 1
Generation: 63 String: I love GeekEforGeeks Fitness: 1
Generation: 64 String: I love GeeksforGeeks Fitness: 0
PS C:\Users\RAJARSI>
If you received a different output do not worry, no two genetic algorithm outputs are ever the same as the entire process runs on randomness. If your code takes longer to run, it’s nothing to worry about. The next run may be faster. But the ultimately the algorithm should end with the string “I love GeeksforGeeks”
如果您收到不同的输出,请不要担心,因为整个过程都是随机进行的,所以没有两个遗传算法输出是相同的。 如果您的代码需要更长的运行时间,则无需担心。 下次运行可能会更快。 但是最终,算法应以字符串“ I love GeeksforGeeks”结尾
应用领域 (Applications)
- Bayesian inference links to particle methods in Bayesian statistics and hidden Markov chain models 贝叶斯推断链接到贝叶斯统计和隐马尔可夫链模型中的粒子方法
- Distributed computer network topologies 分布式计算机网络拓扑
- Electronic circuit design, known as evolvable hardware 电子电路设计,称为可进化硬件
- Learning robot behavior using genetic algorithms 使用遗传算法学习机器人行为
- Image processing: Dense pixel matching 图像处理:密集像素匹配
- Learning fuzzy rule base using genetic algorithms 使用遗传算法学习模糊规则库
- Game theory equilibrium resolution 博弈论均衡解
- And many more… [4] 还有更多…[4]
结论 (Conclusion)
So, in this article, what I have tried first explain what exactly Genetic Algorithms are, then I tried to explain the difference between classical algorithms and genetic algorithms. I focused a lot on the various important terminologies that are used in genetic algorithms and how they are analogous to real-life genetics and biological evolution. The three operations selection, crossover, and mutation are the basic foundation upon which the entire genetic algorithm is based. So, these are the most important operations.
因此,在本文中,我首先尝试解释什么是遗传算法 ,然后尝试解释经典算法和遗传算法之间的区别。 我集中讨论了遗传算法中使用的各种重要术语 ,以及它们如何与现实生活中的遗传学和生物进化类似。 选择,交叉和变异这三个操作是整个遗传算法的基础。 因此,这些是最重要的操作。
Advantages and disadvantages are something that needs to be known before even thinking about applying GA into your problem. As you can see there are quite a few problems that can be solved using genetic algorithms but there many that cannot be or rather would take much more time in solving. So, therefore, I would prefer using GA where the population size of data is very large and thus the randomness would actually take effect. What about you?
优点和缺点是什么需要之前有关应用GA您的问题,甚至思维是已知的。 如您所见,使用遗传算法可以解决很多问题,但是有很多问题无法解决或者将花费更多时间。 因此,因此,我更喜欢使用GA,因为GA的数据量很大,因此随机性实际上会生效。 你呢?
翻译自: https://medium.com/@rajarsi3997/an-insight-into-genetic-algorithms-93428953c098
遗传算法 退火算法