📄 graph.h
字号:
#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -