typedef enum{DG,DN,UDG,UDN} GraphKind;//图的类型
bool visited[MAX_VERTEX_NUM];
//邻接矩阵
typedef struct ArcCell
{
VRType adj;//权值
InfoType *info;
}ArcCell,AdjMartix[MAX_VERTEX_NUM][MAX_VERTEX_NUM];
typedef struct
{
VertexType vexs[MAX_VERTEX_NUM]; //顶点向量
AdjMartix arcs; //邻接矩阵
int vexnum,arcnum; //图当前顶点数,弧数
GraphKind Kind; //图的类型
}MGraph;
bool VexExist(MGraph G,VertexType v)//判断定点是否在图中
{
评论0
最新资源