tsp.h

来自「本程序实现了NPC问题旅行商的三个近似算法。」· C头文件 代码 · 共 32 行

H
32
字号
#define N 32
#include <iostream.h>
#include <stdio.h>
#include <algorithm>
using namespace std;

class tsp
{
public:
	tsp();
	~tsp();
	bool LoadGraph();
	bool NearestNeighbor();
	bool ShortestLinkHeuristic();
	bool NearestInsertion();
	int findaedge(bool *, int);
private:
	int iCityNum;
	int Graph[N][N];
};

struct edge_info
{
	int fee;
	int c1, c2;
};

struct link_state
{
	int p[2], neighbor;
};

⌨️ 快捷键说明

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