蚁群算法 c语言,蚁群算法C语言程序(已运行).doc-资源下载在线文库www.lddoc.cn

蚁群算法 C语言程序(已运行).doc

Basic Ant Colony Algorithm for TSP include include include include include include include define N 31 city size define M 31 ant number double inittao1; double taoNN; double detataoNN; double distanceNN; double yitaNN; int tabuMN; int routeMN; double solutionM; int BestRouteN; double BestSolution10000000000; double alfa,beta,rou,Q; int NcMax; void initparametervoid; initialize the parameters of basic ACA double ueSolutionint *a; uate the solution of TSP, and calculate the length of path void InCityXY double x, double y, char *infile ; the nodes coordinates of TSP void initparametervoid alfa1; beta5; rou0.9; Q100; NcMax200; void mainvoid int NC0; initparameter; double xN; double yN; InCityXY x, y, “city31.tsp“ ; forint i0;idrand break; tabukj1; routeksj; s; the pheromone is updated fori0;i20 taoij20; fork0;k filen“; exit0; result filen“; exit0; int i0; while inxyfile.eof inxyfilexiyi; if i N break; 本文来自 CSDN 博客,转载请标明出处

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值