Kruskal算法求图的最小生成树.docVIP

  • 8
  • 0
  • 约2.02千字
  • 约 3页
  • 2019-10-15 发布于江西
  • 举报
利用Kruskal算法求图的最小生成树 程序设计 2007-10-09 22:23 阅读160 评论1 字号: 大大 中中 小小 /*利用Kruskal算法求图的最小生成树(2007.8.7)*/ #includestdio.h #includestdlib.h #define MaxVertexNum 12 #define MaxEdgeNum 20 #define MaxValue 1000 typedef int VertexType; typedef VertexType vexlist[MaxVertexNum]; typedef int adjmatrix[MaxVertexNum][MaxVertexNum]; int visited[MaxVertexNum]={0}; struct edgeElem { int fromvex; /*边的起点域*/ int endvex; /*边的终点域*/ int weight; /*边的权值域*/ }; typedef struct edgeElem edgeset[MaxEdgeNum]; void Kruskal(edgeset GE ,edgeset C,int n) { int i,j,k,d,m1,m2; adjmatrix s; for(

文档评论(0)

1亿VIP精品文档

相关文档