简体   繁体   English

遗传编程和搜索算法

[英]Genetic Programming and Search Algorithms

Is Genetic Programming currently capable of evolving one type of search algorithm into another? 遗传编程目前是否能够将一种搜索算法发展为另一种? For example, has any experiment ever ever bred / mutated BubbleSort from QuickSort (see http://en.wikipedia.org/wiki/Sorting_algorithm ) 例如,有任何实验曾经从QuickSort培育/变异BubbleSort(参见http://en.wikipedia.org/wiki/Sorting_algorithm

You might want to look at the work of W. Daniel Hillis from the 80s. 你可能想看看80年代W. Daniel Hillis的作品。 He spent a great deal of time creating sorting networks by genetic programming. 他花了很多时间通过遗传编程创建分选网络。 While he was more interested in solving the problem of sorting a constant number of objects (16-object sorting networks had been a major academic problem for nearly a decade,) it would be a good idea to be familiar with his work if you're really interested in genetic sorting algorithms. 虽然他更感兴趣的是解决对恒定数量的对象进行排序的问题(16个对象排序网络已经成为近十年来的一个主要学术问题),但如果你是熟悉他的工作将是一个好主意。对遗传排序算法真的很感兴趣。

In the evolution of an algorithm for sorting a list of arbitrary length, you might also want to be familiar with the concept of co-evolution. 在用于对任意长度列表进行排序的算法的演变中,您可能还希望熟悉协同进化的概念。 I've built a co-evolutionary system before where the point was to have one genetic algorithm evolving sorting algorithms while another GA develops unsorted lists of numbers. 我已经构建了一个协同进化系统,之前有一个遗传算法用于演化排序算法,而另一个GA则开发出未排序的数字列表。 The fitness of the sorter is its accuracy (plus a bonus for fewer comparisons if it is 100% accurate) and the fitness of the list generator is how many errors sort algorithms make in sorting its list. 分拣机的适用性是其准确性(如果100%准确,则加上较少比较的奖励),并且列表生成器的适合度是排序算法在排序其列表时产生的错误数量。

To answer your specific question of whether bubble had ever been evolved from quick, I would have to say that I would seriously doubt it, unless the programmer's fitness function was both very specific and ill-advised. 为了回答你关于泡沫是否从快速演变过来的具体问题,我不得不说我会严重怀疑它,除非程序员的健身功能既非常具体又缺乏建议。 Yes, bubble is very simple, so maybe a GP whose fitness function was accuracy plus program size would eventually find bubble. 是的,泡沫非常简单,所以也许GP的适应度函数是精确度加上程序大小最终会发现泡沫。 However, why would a programmer select size instead of number of comparisons as a fitness function when it is the latter that determines runtime? 但是,当后者决定运行时,为什么程序员会选择大小而不是比较次数作为适应度函数?

By asking if GP can evolve one algorithm into another, I'm wondering if you're entirely clear on what GP is. 通过询问GP是否可以将一种算法演变为另一种算法,我想知道你是否完全清楚GP是什么。 Ideally, each unique chromosome defines a unique sort. 理想情况下,每个独特的染色体定义一种独特的类 A population of 200 chromosomes represents 200 different algorithms. 200个染色体的群体代表200种不同的算法。 Yes, quick and bubble may be in there somewhere, but so are 198 other, potentially unnamed, methods. 是的,快速和泡沫可能在某处,但其他198种可能未命名的方法也是如此。

There's no reason why GP couldn't evolve eg either type of algorithm. GP没有理由不能进化,例如任何一种算法。 I'm not sure that it really makes sense to think of evolving one "into" the other. 我不确定将一个“进入”另一个进入是否真的有意义。 GP will simply evolve a program that comes ever-closer to a fitness function you define. GP将简单地改进一个程序,该程序越来越接近您定义的适应度函数。

If your fitness function only looks at sort correctness (and assuming you have the proper building blocks for your GP to use) then it could very well evolve both BubbleSort and QuickSort. 如果您的健身功能仅查看排序正确性(假设您有适合您的GP使用的构建块),那么它可以很好地发展BubbleSort和QuickSort。 If you also include efficiency as a measure of fitness, then that might influence which of these would be determined as a better solution. 如果您还将效率作为衡量适应度的指标,那么这可能会影响哪些因素被确定为更好的解决方案。

You could seed the GP with eg QuickSort and if you had an appropriate fitness function it certainly could eventually come up with BubbleSort - but it could come up with anything else that is fitter than QuickSort as well. 您可以使用例如QuickSort为GP播种,如果您有适当的健身功能,它肯定最终可以提供BubbleSort - 但它可以提出比QuickSort更适合的任何其他东西。

Now how long it takes the GP engine to do this evolution is another question... 现在GP引擎进行这种演变需要多长时间才是另一个问题......

I'm not aware of one, and the particular direction you're suggesting in your example seems unlikely; 我不知道一个,你在你的例子中提出的具体方向似乎不太可能; it would take a sort of perverse fitness function, since bubble sort is in most measures worse than quicksort. 它会采取一种不正常的适应性函数,因为泡沫排序在大多数情况下比快速排序更差。 It's not inconceivable that this could happen, but in general once you've got a well-understood algorithm, it's already pretty fit -- going to another one probably requires passing through some worse choices. 这可能发生这种情况并不是不可思议,但总的来说,一旦你有一个理解得很好的算法,它已经非常适合了 - 去另一个可能需要通过一些更糟糕的选择。

Being trapped in local minima isn't an unknown problem for most search strategies. 对于大多数搜索策略而言,陷入局部最小值并不是一个未知的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM