【文件属性】:
文件名称:遗传算法解决TSP问题代码 C++
文件大小:53KB
文件格式:ZIP
更新时间:2022-01-29 07:19:57
TSP
const int city_num = 144; //城市数目
const int individual_num = 2000; //种群初始值
const int age = 500; //遗传代数
const double varation_p = 0.1; //变异因子
typedef struct City_xy //储存给定的城市数据包含序号和坐标
{
int order;
double x;
double y;
}City_xy;
typedef struct City
{
int mark;
}City;
typedef struct Population
{
City city[145]; //城市数组
double distance; //个体城市序列距离之和
double Fitness; //适应度
double Fitness_pi;
}Population;
【文件预览】:
遗传算法解决TSP问题代码
----king()
--------out.docx(15KB)
--------ga.jpg(25KB)
--------in.docx(12KB)
--------main.docx(14KB)