模拟退火求解TSP问题
/*
* @file2 SA.cpp
* @brief SA解TSP
* @author/Univ. taoxiaoxiao/XMU
* @date 11-2-2014
*/
#include <iostream>
#include <fstream>
#include <random>
using namespace std;
#define max 51 //最大的输入规格
int a[max][max]; //距离矩阵
int curPath[max], newPath[max], bestPath[max]; //当前解、新解、最优解
int length, bestLength = 0; //解的结果、最优解的结果
int n; //输入的节点数
int Lk= 2000; //Mapkob链长
double t = 100.0, alpha = 0.9; //温度、衰减速度
double rand1()
{
//产生0-1间随机数
static defau
模拟退火求解TSP问题(2变换法)

最低0.47元/天 解锁文章
1330

被折叠的 条评论
为什么被折叠?



