文件名称:Prim
- 所属分类:
- 数据结构常用算法
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 92kb
- 下载次数:
- 0次
- 提 供 者:
- Tin****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
用prim算法实验最小生成树
本程序中用到函数adjg( ),此函数作用是通过接受输入的点数和边数,建立无向图。函数prg( )用于计算并输出无向图的邻接矩阵。函数prim( )则用PRIM算法来寻找无向图的最小生成树
定义了两个数组lowcost[max],closest[max],若顶点k加入U中,则令lowcost[k]=0。
定义二维数组g[ ][ ]来建立无向图的邻接矩阵。
-Prim algorithm using minimum spanning tree of the experimental procedures used in function adjg (), this function is through the acceptance of input points and edges, the establishment of a directed graph. Function of prg () used to calculate and output undirected graph of adjacency matrix. Function prim () is used PRIM Algorithm to find the undirected graph of the minimum spanning tree array defines two lowcost [max], closest [max], if it joined the U of k vertices, then the lowcost [k] = 0. The definition of two-dimensional array g [] [] to create a undirected graph of adjacency matrix.
本程序中用到函数adjg( ),此函数作用是通过接受输入的点数和边数,建立无向图。函数prg( )用于计算并输出无向图的邻接矩阵。函数prim( )则用PRIM算法来寻找无向图的最小生成树
定义了两个数组lowcost[max],closest[max],若顶点k加入U中,则令lowcost[k]=0。
定义二维数组g[ ][ ]来建立无向图的邻接矩阵。
-Prim algorithm using minimum spanning tree of the experimental procedures used in function adjg (), this function is through the acceptance of input points and edges, the establishment of a directed graph. Function of prg () used to calculate and output undirected graph of adjacency matrix. Function prim () is used PRIM Algorithm to find the undirected graph of the minimum spanning tree array defines two lowcost [max], closest [max], if it joined the U of k vertices, then the lowcost [k] = 0. The definition of two-dimensional array g [] [] to create a undirected graph of adjacency matrix.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Prim算法
........\Prim.cpp
........\Prim.dsp
........\Prim.exe
........\Prim.cpp
........\Prim.dsp
........\Prim.exe