文件名称:FindaMininalSpanningTree
介绍说明--下载内容均来自于网络,请自行研究使用
输入含权图的邻接矩阵,输出最小生成树的邻接矩阵
1、本实验用到的理论知识
Prim算法
算法设计
设图G =(V,E),其生成树的顶点集合为U。
①、把v0放入U。
②、在所有u∈U,v∈V-U的边(u,v)∈E中找一条最小权值的边,加入生成树。
③、把②找到的边的v加入U集合。如果U集合已有n个元素,则结束,否则继续执行②。-Enter the right graph with adjacency matrix, the output of the adjacency matrix of a minimum spanning tree, this experiment used the theoretical knowledge Prim algorithm for algorithm design based map G = (V, E), its spanning the vertex set of U. ①, the v0 into U. ②, in all u ∈ U, v ∈ VU edge (u, v) ∈ E in finding a minimum weight edge, by adding spanning tree. ③, ② to find the edge to join the U of v set. If U has a collection of n elements, then the end, otherwise continue ②.
1、本实验用到的理论知识
Prim算法
算法设计
设图G =(V,E),其生成树的顶点集合为U。
①、把v0放入U。
②、在所有u∈U,v∈V-U的边(u,v)∈E中找一条最小权值的边,加入生成树。
③、把②找到的边的v加入U集合。如果U集合已有n个元素,则结束,否则继续执行②。-Enter the right graph with adjacency matrix, the output of the adjacency matrix of a minimum spanning tree, this experiment used the theoretical knowledge Prim algorithm for algorithm design based map G = (V, E), its spanning the vertex set of U. ①, the v0 into U. ②, in all u ∈ U, v ∈ VU edge (u, v) ∈ E in finding a minimum weight edge, by adding spanning tree. ③, ② to find the edge to join the U of v set. If U has a collection of n elements, then the end, otherwise continue ②.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
实验一 Find a Mininal Spanning Tree.doc