⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.cpp

📁 本程序实现了NPC问题旅行商的三个近似算法。
💻 CPP
字号:
#include <iostream.h>
#include "TSP.h"
int main()
{
	tsp ct;
	int index;
	while(1)
	{
	
		ct.LoadGraph();
		cout << "please choose a tsp algotithm:" << endl;
		cout << "1:NearestNeighbor   2:ShortestLinkHeuristic   3:NearestInsertion" << endl;
		cin >> index;
		if(index<1 || index >3) 
		{
			cout << "index error! choose again." << endl;
			continue;
		}
		switch(index)
		{
		case 1: { ct.NearestNeighbor(); break; }	
		case 2: { ct.ShortestLinkHeuristic(); break; }
		case 3: { ct.NearestInsertion(); }
		}
	}
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -