文件名称:prim
介绍说明--下载内容均来自于网络,请自行研究使用
掌握Prim算法的特点,学会用Prim算法构造最小生成树
如果无向连通图是一个网,那么它的所有生成树中必有一棵树的边的权值总和为最小,我们称这棵生成树为最小生成树。在Prim算法中,在图G=(V,E)(V表示顶点,E表示边)中任选一点V0,令集合U={V0}为初态,从V0出发寻找与U中顶点相邻(另一顶点在V中)且代价最小的边的另一顶点V1,并使V1加入U,即U={V0,V1},同时(V0,V1)边加入集合T中(T的初态为空),这样不断地扩大U,直到U=V,则T中即为最小生成树的边。
-Grasp the characteristics of Prim algorithm, learning algorithm constructed by Prim minimum spanning tree if the undirected connected graph is a network, then it must be all the spanning tree in the side of a tree weight value sum for the smallest, spanning tree, we called for minimum spanning tree. In the Prim algorithm, in Figure G = (V, E) (V said vertex, E said that edges) in one point V0, the collection U = (V0) for the initial state, starting from V0 to find the adjacent vertex of U (another vertex in V in) and the cost of the other side of the smallest vertex V1, and V1 to join U, namely U = (V0, V1), at the same time (V0, V1) to include in the collection side of T in (T of the initial state is empty), this continues to expand U, until U = V, then T is the minimum spanning tree in the side.
如果无向连通图是一个网,那么它的所有生成树中必有一棵树的边的权值总和为最小,我们称这棵生成树为最小生成树。在Prim算法中,在图G=(V,E)(V表示顶点,E表示边)中任选一点V0,令集合U={V0}为初态,从V0出发寻找与U中顶点相邻(另一顶点在V中)且代价最小的边的另一顶点V1,并使V1加入U,即U={V0,V1},同时(V0,V1)边加入集合T中(T的初态为空),这样不断地扩大U,直到U=V,则T中即为最小生成树的边。
-Grasp the characteristics of Prim algorithm, learning algorithm constructed by Prim minimum spanning tree if the undirected connected graph is a network, then it must be all the spanning tree in the side of a tree weight value sum for the smallest, spanning tree, we called for minimum spanning tree. In the Prim algorithm, in Figure G = (V, E) (V said vertex, E said that edges) in one point V0, the collection U = (V0) for the initial state, starting from V0 to find the adjacent vertex of U (another vertex in V in) and the cost of the other side of the smallest vertex V1, and V1 to join U, namely U = (V0, V1), at the same time (V0, V1) to include in the collection side of T in (T of the initial state is empty), this continues to expand U, until U = V, then T is the minimum spanning tree in the side.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
二分法
......\prim.cpp
......\prim.cpp