渭南师范学院学报
渭南師範學院學報
위남사범학원학보
Journal of Weinan Teachers College
2015年
22期
35-38
,共4页
邻接矩阵%无向连通图%Prim算法%图的生成树%时间复杂度%空间复杂度
鄰接矩陣%無嚮連通圖%Prim算法%圖的生成樹%時間複雜度%空間複雜度
린접구진%무향련통도%Prim산법%도적생성수%시간복잡도%공간복잡도
adjacency matrix%undirected connected graph%prim algorithm%spanning tree of graph%time complexity%space complexity
以消除无向连通图中构成环路的冗余边的算法为主线,引入并介绍了图形数据结构的逻辑结构和基本概念,通过对比分析图的几个常用存储结构的优缺点,确定选用邻接矩阵存储结构来存储无向连通图。详细分析如何利用近似Prim算法得到无向连通图的最小生成树,给出了算法的设计思路以及实现的方法和步骤,并给出通过广度优先搜索遍历实现该算法的C语言描述,最后对算法从时间复杂度和空间复杂度两个方面进行了评价。
以消除無嚮連通圖中構成環路的冗餘邊的算法為主線,引入併介紹瞭圖形數據結構的邏輯結構和基本概唸,通過對比分析圖的幾箇常用存儲結構的優缺點,確定選用鄰接矩陣存儲結構來存儲無嚮連通圖。詳細分析如何利用近似Prim算法得到無嚮連通圖的最小生成樹,給齣瞭算法的設計思路以及實現的方法和步驟,併給齣通過廣度優先搜索遍歷實現該算法的C語言描述,最後對算法從時間複雜度和空間複雜度兩箇方麵進行瞭評價。
이소제무향련통도중구성배로적용여변적산법위주선,인입병개소료도형수거결구적라집결구화기본개념,통과대비분석도적궤개상용존저결구적우결점,학정선용린접구진존저결구래존저무향련통도。상세분석여하이용근사Prim산법득도무향련통도적최소생성수,급출료산법적설계사로이급실현적방법화보취,병급출통과엄도우선수색편력실현해산법적C어언묘술,최후대산법종시간복잡도화공간복잡도량개방면진행료평개。
The key of this paper is the algorithm about eliminating the redundant edges constituting a loop in undirected con?nected graph. This paper introduces the logic structure patterns and the basic concepts of graph data structure, compares and analy?zes the advantages and disadvantages of several common storage structures, and then chooses the adjacency matrix storage structure to store the undirected connected graph. The paper analyzes in detail how to compute out the spanning tree of the undirected connect?ed graph through a specific algorithm approximating to the Prim algorithm, introduces the design ideas, implementation approaches and concrete steps of the algorithm, gives the algorithm implementation description of the breadth first search traversal in C lan?guage, and finally evaluates the algorithm from the two aspects of time complexity and space complexity.