遗传算法解决城市TSP问题程序源代码.docVIP

  • 21
  • 0
  • 约6.58千字
  • 约 10页
  • 2017-08-30 发布于安徽
  • 举报

遗传算法解决城市TSP问题程序源代码.doc

#include stdio.h #include stdlib.h #include conio.h #include math.h #include time.h #define num_C 10 //城市个数 #define N 100 //群体规模为100 #define pc 0.9 //交叉概率为0.9 #define pm 0.1 //变异概率为10% #define ps 0.6 //进行选择时保留的比例 #define genmax 200 //最大代数200 int RandomInteger(int low,int high); void Initial_gen(struct unit group[N]); void Sort(struct unit group[N]); void Copy_unit(struct unit *p1,struct unit *p2); int search_son(int son[num_C],int k); void Cross(struct unit *p1,struct unit *p2); void Varation(struct unit group[N],int i); void Evolution(struct unit group[N]); void Calcu

文档评论(0)

1亿VIP精品文档

相关文档