typedef struct ArcCell{
VRType adj;
InfoType *info;
}ArcCell,AdjMatrix[MAX][MAX];
typedef struct {
VertexType vexs[MAX];
AdjMatrix arcs;
int vexnum,arcnum;
}MGraph;
typedef struct{
VertexType adjvex;
VRType lowcost;
}closedge[MAX];
void MiniSpanTree_P(MGraph G, VertexType u) {
for(i=0;i<G.vexnum;i++)
if(G.vexs[i]==u)
k=LocateVex ( G, u );
for (j=0;j<G.vexnum;++j )
if (j!=k)
closedge[j] = {u,G.arcs[k][j].adj };
closedge[k].lowcost = 0;
for (i=0; i<G.vexnum; ++i) {
k = minimum(closedge);
printf(closedge[k].adjvex, G.vexs[k]);
closedge[k].lowcost=0;
for (j=0; j<G.vexnum; ++j)
if (G.arcs[k][j].adj < closedge[j].lowcost)
closedge[j] = { G.vexs[k], G.arcs[k][j].adj };
}
}