文档介绍:总第 254 期计算机与数字工程 V o l. 38 No . 12
2010 年第 12 期 Co mputer & Dig ital Eng ineering
27
遗传算法求最优路径的设计与实现*
赵国忠
陈靖一
凌
韬
( 海军 91551 部队
九江
332005)
摘
要
遗传算法是一种在搜索过程中自动获取和积累有关搜索空间知识, 并自适应地控制搜索过程, 从而得到最优
解或近似最优解的通用搜索算法, 可广泛应用于求解一些非线性、多目标函数的最优化问题。设计了基于遗传算法求解最
优路径问题的方法, 并讨论了以 V isual Studio 2005 为开发环境的实现要点。
关键词
遗传算法; 最优路径
中图分类号
T P301. 6
Design and Implementation of Working out Shortcut by ic Algorithm
Z hao G uozho ng
Chen Jing yi
L ing T a o
( N o. 91551 T roops of N avy , Jiujiang
332005)
Abstract
G enetic a lg orithm, a g eneral search algo rithm that auto matically gets and accumulates the kno wledg e of
search space in the search pro cess, is bro adly applied to w orking out the o pt imum o utco me o f so me no n
linear and mult i
ob
ject functio ns. A method o f searching fo r sho rtcut by g enet ic algo rithm is presented, and its implementatio n points under the
V isual Studio 2005 is discussed.
Key Words
ic alg orithm, shortcut
Class Number
T P301. 6
个种群开始的。种群的每一个体, 都对应于问题的
1
引言
某个解, 称之为
染色体。因此, 该算法的第一步
遗传算法, 是一种借鉴生物界自然选择和自然就是实现从问题领域解的形式到
染色体形式的
遗传机制的随机化搜索算法, 由美国 J. H . H o llad 映射, 即编码[ 2] 。由于仿照基因编码的过程很复
教授提出, 其主要特点是群体搜索策略和群体中个杂, 在实际中往往会进行简化, 如简单常用的二进
体之间的信息交换。该算法尤其适用于处理传统制编码法。按照某种编码方法, 生成一定规模的个
搜索方法难以解决的复杂和非线性问题, 可广泛用体的工作, 称之为初始种群。
于组合优化、机器学****自适应控制、规划设计和人
2. 2
设计适应度函数
[ 1]
工生命等领域。适应度函数用来验证某一个体的适应能力。
顾名思义遗传算法是一个择优汰