遗传算法在求解TSP问题毕业论文.doc
1毕业设计(论文)学院信息工程学院专业计算机科学技术与应用班级1625姓名徐东2007年4月15日2目录摘要IAbstractII引言1第一章基本遗传算法21.1遗传算法的产生及发展.31.2基本原理.31.3遗传算法的特点.31.4基本遗传算法描述.51.5遗传算法构造流程.6第二章遗传算法的实现技术62.1编码方法.72.1.1二进制编码.72.1.2格雷码编码.72.1.3符点数编码.82.1.4参数编码.82.2适应度函数.102.3选择算子.102.4交叉算子.102.4.1单点交叉算子.102.4.2双点交叉算子.112.4.3均匀交叉算子.112.4.4部分映射交叉.112.4.5顺序交叉.122.5变异算子.122.6运行参数.122.7约束条件的处理方法.132.8遗传算法流程图.14第三章遗传算法在TSP上的应用153.1TSP问题的建模与描述.153.2对TSP的遗传基因编码方法.163.3针对TSP的遗传操作算子.173.3.1选择算子.173.3.1.1轮盘赌选择.173.3.1.2最优保存策略选择.173.3.2交叉算子.203.3.2.1单点交叉.203.3.2.2部分映射交叉.213.3.3变异算子.233.4TSP的混和遗传算法.26第四章实例分析274.1测试数据.2734.2测试结果.274.3结果分析.27摘要TSP(TravelingSalesmanProblem)旅行商问题是一类典型的NP完全问题,遗传算法是解决NP问题的一种较理想的方法。文章首先介绍了基本遗传算法的基本原理、特点及其基本实现技术;接着针对TSP问题,论述了遗传算法在编码表示和遗传算子(包括选择算子、交叉算子变异算子这三种算子)等方面的应用情况,分别指出几种常用的编码方法的优点和缺点,并且结合TSP的运行实例详细分析了基本遗传算法的4个运行参数群体大小、遗传算法的终止进化代数、交叉概率、变异概率,对遗传算法的求解结果和求解效率的影响,经过多次的测试设定出了它们一组比较合理的取值。最后,简单说明了混合遗传算法在求解TSP问题中的应用并对遗传算法解决TSP问题的前景提出了展望。关键词:TSP遗传算法遗传算子编码4AbstractTSP(TravelingSalesmanProblem)isatypicalNP-completeproblemandgeneticalgorithm(GA)istheperfectmethodforsolvingNP-completeproblem.Thebasictheories,characteristicsandthebasictechniquesofGAarefirstintroduced.Thentheencodingmodelandgeneticoperators(includingselectionoperation,crossoveroperationandmutationoperation)aboutGAinsolvingTSParediscussed.Theadvantagesanddisadvantagesofvariousencodingmethodarerespectivelyindicated,andtheapplicationofthethreebasicgeneticoperatorsiselaborated.Accordingtothegivendata,theresultsandefficienciesareinfluencedbyfourparametersinthebasicgeneticalgorithm:thesizeofpopulation,terminategeneration,crosserprobabilityandmutationprobability.Adjusttheparameters,runandtryforbetterones.Atlast,theapplicationofhybridgeneticalgorithmisbrieflypresented.Itispointedoutthatabettercrossoverormutationroutinecanbefoundoutwhichretainsthestructurefromtheparentchromosomesandstillendsupwithalegaltourinthechildchromosomes,whichleadstoabettersolutionthaneverbefore.AndtheprospectforthefutureofgeneticalgorithminsolvingTSPismade.Keywords:TSPgeneticalgorithmgeneticoperatorsencoding