遗传算法和遗传编程之间有什么区别? [英] What are the differences between genetic algorithms and genetic programming?

查看:325
本文介绍了遗传算法和遗传编程之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想简单地解释一下遗传算法和遗传编程之间的区别(没有太多的编程术语).例子也将不胜感激.

I would like to have a simple explanation of the differences between genetic algorithms and genetic programming (without too much programming jargon). Examples would also be appreciated.

显然,在基因编程中,解决方案是计算机程序.另一方面,遗传算法将解决方案表示为一串数字.还有其他区别吗?

Apparently, in genetic programming, solutions are computer programs. On the other hand, genetic algorithms represent a solution as a string of numbers. Any other differences?

推荐答案

遗传编程和遗传算法非常相似.通过比较各个世代之间的潜在候选人群体中的每个候选人的适应度,他们都可以用来发展问题的答案.

Genetic programming and genetic algorithms are very similar. They are both used to evolve the answer to a problem, by comparing the fitness of each candidate in a population of potential candidates over many generations.

每一代,都可以通过随机更改(变异)或交换其他候选的部分(交叉)来找到新的候选.最不适合的人选从人口中删除.

Each generation, new candidates are found by randomly changing (mutation) or swapping parts (crossover) of other candidates. The least 'fit' candidates are removed from the population.

它们之间的主要区别在于算法/程序的表示形式.

The main difference between them is the representation of the algorithm/program.

遗传算法表示为动作和值的列表,通常是字符串.例如:

A genetic algorithm is represented as a list of actions and values, often a string. for example:

1+x*3-5*6

必须为这种编码编写一个解析器,以了解如何将其转换为函数.结果函数可能如下所示:

A parser has to be written for this encoding, to understand how to turn this into a function. The resulting function might look like this:

function(x) { return 1 * x * 3 - 5 * 6; }

解析器还需要知道如何处理无效状态,因为变异和交叉操作并不关心算法的语义,例如,可能会产生以下字符串:1+/3-2*.需要确定一种处理这些无效状态的方法.

The parser also needs to know how to deal with invalid states, because mutation and crossover operations don't care about the semantics of the algorithm, for example the following string could be produced: 1+/3-2*. An approach needs to be decided to deal with these invalid states.

遗传程序表示为动作和值的树形结构,通常是嵌套的数据结构.这是相同的示例,以树的形式说明:

A genetic program is represented as a tree structure of actions and values, usually a nested data structure. Here's the same example, illustrated as a tree:

      -
   /     \
  *       *
 / \     / \
1   *   5   6
   / \
  x   3

还必须为该编码编写一个解析器,但是遗传编程不会(通常)产生无效状态,因为变异和交叉操作在树的结构内起作用.

A parser also has to be written for this encoding, but genetic programming does not (usually) produce invalid states because mutation and crossover operations work within the structure of the tree.

遗传算法

  • 本质上具有固定长度,这意味着结果函数具有一定的复杂度
  • 通常会产生无效状态,因此需要进行非破坏性处理
  • 通常依赖于运算符的优先级(例如,在我们的示例中,乘法运算是在减法之前发生的),这可以看作是一种局限性

遗传程序

  • 固有的长度是可变的,这意味着它们更灵活,但复杂度通常会增加
  • 很少产生无效状态,通常可以将其丢弃
  • 使用显式结构来完全避免运算符优先级

这篇关于遗传算法和遗传编程之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆