graph.h
来自「旅行商问题问题的二叉树求解方法」· C头文件 代码 · 共 46 行
H
46 行
#ifndef _GRAPH_H
#define _GRAPH_H
/************************************************************************/
/* 定义图像类型的数据结构 */
/************************************************************************/
typedef struct graph {
int arcnum;
int vernum;
int *nermat;
bool suit;
}graph;
typedef struct arc {
int start;
int end;
int weight;
}arc;
/************************************************************************/
/*从文件中读入图像信息并构成图像
/************************************************************************/
graph* creatgraph(char*);
/************************************************************************/
/*得到图像的边信息
/************************************************************************/
void getarcinfo(graph* g,arc * a);
/************************************************************************/
/*对图像进行旅行商问题搜索
/************************************************************************/
int* TSP(graph* g);
/************************************************************************/
/*根据当前的状态获取几条边
/************************************************************************/
void getarcinfo(graph* g,arc * a);
/************************************************************************/
/*测试这几条边能不能构成回路
/************************************************************************/
bool test(arc*a,int* ser,int n);
/************************************************************************/
/*根据当前的状态获取几条边
/************************************************************************/
void getarc(arc* a,int *ser,int n);
/************************************************************************/
/*根据边的序号显示旅行商的路径信息
/************************************************************************/
void shoepath(arc* a,int* ser,int n);
#endif//graph.h
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?