- 7
- 0
- 约 22页
- 2016-12-20 发布于重庆
- 举报
* * 回顾: #define INFINITY INT_MAX #define MAX_V_NUM 20 typedef enum {DG,DN,UDG,UDN} GrahpKind; typedef struct ArcCell{ VRType adj; InfoType *info; }ArcCell,AdjMatrix[MAX_V_NUM][MAX_V_NUM]; typedef struct{ VertexType vexs[MAX_V_NUM]; AdjMatrix arcs; int vexnum, arcnum; GraphKind kind; } MGraph; void ShortestPath_DIJ(MGraph G, int v0, PathMatrix p, ShortPathTable D){ \* p为布尔矩阵,用每一行标识一个顶点到v0的最短路径包含那些顶点 for(v=0; vG.vexnum; ++v){ final[v]=FALSE; \*初始时,所有顶点都不在S中 D[v]=G.arcs[v0][v]; for(w=0; wG.vexnum; ++w) P[v][w]=FALSE; if(D[v]INFINIY){P[v][v0]=TRU
原创力文档

文档评论(0)