遗传算法(GA)和遗传规划(GP)是一个有趣的研究领域。

我想知道你使用GA/GP解决的具体问题,以及如果你没有自己的库/框架,你使用了什么库/框架。

问题:

你用GA/GP解决过什么问题? 你使用了哪些库/框架?

我在寻找第一手的经验,所以请不要回答,除非你有。


当前回答

In 2007-9 I developed some software for reading datamatrix patterns. Often these patterns were difficult to read, being indented into scratched surfaces with all kinds of reflectance properties, fuzzy chemically etched markings and so on. I used a GA to fine tune various parameters of the vision algorithms to give the best results on a database of 300 images having known properties. Parameters were things like downsampling resolution, RANSAC parameters, amount of erosion and dilation, low pass filtering radius, and a few others. Running the optimisation over several days this produced results which were about 20% better than naive values on a test set of images unseen during the optimisation phase.

这个系统完全是从零开始编写的,我没有使用任何其他库。我并不反对使用这些东西,只要它们能提供可靠的结果,但是您必须注意许可兼容性和代码可移植性问题。

其他回答

首先,Jonathan Koza的《遗传编程》(在亚马逊上)几乎是一本关于遗传和进化算法/编程技术的书,有很多例子。我强烈建议你去看看。

As for my own use of a genetic algorithm, I used a (home grown) genetic algorithm to evolve a swarm algorithm for an object collection/destruction scenario (practical purpose could have been clearing a minefield). Here is a link to the paper. The most interesting part of what I did was the multi-staged fitness function, which was a necessity since the simple fitness functions did not provide enough information for the genetic algorithm to sufficiently differentiate between members of the population.

There was an competition on codechef.com (great site by the way, monthly programming competitions) where one was supposed to solve an unsolveable sudoku (one should come as close as possible with as few wrong collumns/rows/etc as possible).What I would do, was to first generate a perfect sudoku and then override the fields, that have been given. From this pretty good basis on I used genetic programming to improve my solution.I couldn't think of a deterministic approach in this case, because the sudoku was 300x300 and search would've taken too long.

Several years ago I used ga's to optimize asr (automatic speech recognition) grammars for better recognition rates. I started with fairly simple lists of choices (where the ga was testing combinations of possible terms for each slot) and worked my way up to more open and complex grammars. Fitness was determined by measuring separation between terms/sequences under a kind of phonetic distance function. I also experimented with making weakly equivalent variations on a grammar to find one that compiled to a more compact representation (in the end I went with a direct algorithm, and it drastically increased the size of the "language" that we could use in applications).

最近,我将它们用作默认假设,以此来测试由各种算法生成的解决方案的质量。这主要涉及分类和不同类型的拟合问题(即创建一个“规则”,解释审查员对数据集所做的一组选择)。

在工作中,我遇到了这样一个问题:给定M个任务和N个dsp,如何将任务分配给dsp是最好的?“最佳”定义为“最大负载DSP的负载最小化”。有不同类型的任务,不同的任务类型有不同的性能分支,这取决于它们被分配到哪里,所以我将一组工作到dsp的分配编码为“DNA字符串”,然后使用遗传算法来“培育”我所能“培育”的最佳分配字符串。

它运行得相当好(比我之前的方法好得多,之前的方法是评估每个可能的组合……对于非平凡问题的大小,它将需要数年才能完成!),唯一的问题是无法判断是否已经达到了最优解。你只能决定当前的“最大努力”是否足够好,或者让它运行更长时间,看看它是否可以做得更好。

我开发了一个基于多线程摆动的模拟机器人导航通过一组随机网格地形的食物源和矿山,并开发了一个基于遗传算法的策略,探索机器人行为的优化和机器人染色体的适者生存基因。这是使用每个迭代周期的图表和映射来完成的。

从那以后,我发展了更多的游戏行为。我最近为自己构建的一个示例应用程序是一个遗传算法,用于解决在英国寻找路线时的旅行销售人员问题,考虑到起始和目标状态,以及一个/多个连接点,延误,取消,建筑工程,高峰时间,公共罢工,考虑最快和最便宜的路线。然后为某一天的路线提供一个平衡的建议。

一般来说,我的策略是使用基于POJO的基因表示,然后为选择、突变、交叉策略和标准点应用特定的接口实现。我的适应度函数就会变得非常复杂,这是基于我需要作为启发式测量应用的策略和标准。

我还研究了将遗传算法应用于代码中的自动化测试,使用系统突变周期,其中算法理解逻辑,并尝试确定带有代码修复建议的错误报告。基本上,这是一种优化我的代码并提供改进建议的方法,以及一种自动发现新编程代码的方法。我还尝试将遗传算法应用于音乐制作和其他应用。

一般来说,我发现进化策略就像大多数元启发式/全局优化策略一样,一开始学习很慢,但随着解决方案越来越接近目标状态,只要你的适应度函数和启发式很好地对齐,在你的搜索空间内产生收敛,它们就会开始学习。