演化计算遗传算法
Genetic algorithms are a type of evolutionary algorithms that are inspired by the process of natural selection. I have already introduced genetic algorithms in my previous article, Introduction to Genetic Algorithms — Including Example Code. Go check it out if you haven’t already!
遗传算法是一种进化算法,受自然选择过程的启发。 在上一篇文章《遗传算法简介-包括示例代码》中 ,我已经介绍了遗传算法。 如果还没有,去看看吧!
Recently I noticed that one reply I had left for a response about scheduling timetables using genetic algorithms has been really useful to many. Hence, I thought of expanding that reply into an article so that it will be of more use to the readers. Let’s get started.
最近,我注意到我留下的一个关于使用遗传算法安排时间表的响应的回复对许多人确实很有用。 因此,我考虑将该答复扩展为一篇文章,以使它对读者有更多用处。 让我们开始吧。
什么是遗传算法? (What is a Genetic Algorithm?)
Quoting from my previous article,
引用我上一篇文章,
A genetic algorithm is a search heuristic that is inspired by Charles Darwin’s theory of natural evolution. This algorithm reflects the process of natural selection where the fittest individuals are selected for reproduction in order to produce offspring of the next generation.
遗传算法是一种搜索启发式方法,受查尔斯·达尔文(Charles Darwin)的自然进化论启发。 该算法反映了自然选择的过程,在该过程中,选择最适合的个体进行繁殖,以产生下一代的后代。
If you want to know more about genetic algorithms, you can read my article Introduction to Genetic Algorithms — Including Example Code where I have explained every phase with examples.
如果您想了解有关遗传算法的更多信息,请阅读我的文章遗传算法简介-包括示例代码 在这里我用示例解释了每个阶段。
To summarise, the 5 main phases of a genetic algorithm are,
总而言之,遗传算法的五个主要阶段是:
- Initial population 初始人口
- Fitness function 健身功能
- Selection 选拔
- Crossover 交叉
- Mutation 突变
The following figure denotes the flow chart of how a general genetic algorithm works.
下图显示了通用遗传算法的工作流程图。