文件名称:Prim
介绍说明--下载内容来自于网络,使用问题请自行百度
算法特点:该算法的特点是当前形成的集合T始终是一棵树。将T中U和TE分别看作红点和红边集,V-U看作蓝点集。算法的每一步均是在连接红、蓝点集的紫边中选择一条轻边扩充进T中。MST性质保证了此边是安全的。T从任意的根r开始,并逐渐生长直至U=V,即T包含了 C中所有的顶点为止。MST性质确保此时的T是G的一棵MST。因为每次添加的边是使树中的权尽可能小,因此这是一种"贪心"的策略。
-Algorithm characteristics: the algorithm is characterized by the formation of the current set of T is always a tree. The T, U and TE were seen as red dots and red edge set, VU as a blue dot set. Every step of the algorithm are connecting the red, blue, choose a set of purple fringing to expand into the T in the light side. The nature side of MST to ensure that this is safe. T starting from any root r, and gradually grow up to U = V, ie T contains all the vertices of C so far. MST to ensure that this time the nature of the tree T is a G MST. Because each side is to add the right tree as small as possible, so this is a " greedy" strategy.
-Algorithm characteristics: the algorithm is characterized by the formation of the current set of T is always a tree. The T, U and TE were seen as red dots and red edge set, VU as a blue dot set. Every step of the algorithm are connecting the red, blue, choose a set of purple fringing to expand into the T in the light side. The nature side of MST to ensure that this is safe. T starting from any root r, and gradually grow up to U = V, ie T contains all the vertices of C so far. MST to ensure that this time the nature of the tree T is a G MST. Because each side is to add the right tree as small as possible, so this is a " greedy" strategy.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
用普里姆(Prim)算法构造最小生成树.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.