摘要:
#include #include #include #include #include #include using namespace std; //邻接矩阵显示图 void show_graph(vector> &graph) { for (int i = 0; i > &graph,vector &visited,int v) { cout "; visited[v] ... 阅读全文
摘要:
//最小生成树:prim法则 void prim(vector> &graph, vector &visited) { stack mys; int mark = 255; int x = 0, y = 0; for (int i = 0; i "; cout "; mark = graph.size() - 2; int count = 0; while (mark-- && ... 阅读全文
摘要:
//最短路径:迪杰斯算法 void DJS(vector> &graph,vector &certain, vector &pre,vector &length,int v) { certain[v] = true; pre[v] = v; length[v] = 0; for (int i = 0; i (graph[j][k] + length[j])) { ... 阅读全文