Westward data structure notes - Chapter VII map

FIG 1 is defined

 

 

 1) the definition of the various figures

 

 

 

 

 

 

 2) and the edges between the vertices of the relationship of FIG.

 

 

 

 3) communicates FIG Related Terms

 

 

 

 

 

 4) the definition of the term are summarized in FIG.

FIG 2 is an abstract data type

3 of the storage structure of FIG.

 

 1) the adjacency matrix

 

 

 

 

 

 

 Time complexity of O (n).

 2) adjacency table

 

 

 

 

 3) Cross List

 

 4) abuts multilist

 

 

 

 5) the edge of arrays

 

 

FIG 4 is traversed

 1) depth-first traversal

 

 

 

 

 2) breadth-first traversal

 

5 minimum spanning tree of FIG.

 

By the previous study, with n vertices for communicating FIG it may contain multiple spanning trees , for example, FIG.  1 shows:

Puli Mu algorithm (Prim):

First select a node as a whole, in all the remaining nodes with the shortest side of all the sides selected overall, classified as a vertex to put this emerging side of this whole, then left with a whole new synthetic select all the edges of all the nodes in a shortest side, put this one vertex side fall into this emerging whole, and so on, until all the nodes traversed. (Target node to build the minimum spanning tree, suitable for more dense FIG number of sides)

【step】

(1) selecting a node from the graph as starting node (also the root of the tree), labeled reached; initialize all node distance less than the distance to the tree to the root node ;

(2) is selected from the remaining nodes in the tree less than the shortest distance from node i, labeled reached; update distance less than the tree node (if the node is less than the distance from node i to the current distance, update);

(3) Repeat step 2 until all n nodes are reached.

Kruskal algorithm (Kruskal):

In FIG weighted communicating constantly find the minimum set of edges in the edge if the edge is obtained the minimum spanning tree satisfies the condition, it will be configured until finally obtain a minimum spanning tree. (To build the minimum spanning tree for the target edge, for a small number of edges sparse graph)

【step】

(1)将所有边的边权从小到大依次排列,并且均标为未选

(2)选择最小的未选边

(3)如果该边与前面所选的边无法构成回路,则选中该边,并标为已选;如果该边与前面所选的边构成了回路,则不选该边,并标为已选

(4)重复(2)(3),直到所有点之间都有边相连;

 

 

 

 

6 最短路径

 

迪杰斯特拉算法(Dijkstra):

迪杰斯特拉最最朴素的思想就是按长度递增的次序产生最短路径。即每次对所有可见点的路径长度进行排序后,选择一条最短的路径,这条路径就是对应顶点到源点的最短路径。

迪杰斯特拉算法总共就干了两件事:

【1】不断运行广度优先算法找可见点,计算可见点到源点的距离长度

【2】从当前已知的路径中选择长度最短的将其顶点加入S作为确定找到的最短路径的顶点。

看完这段视频就可以清楚迪杰斯特拉算法的过程:迪杰斯特拉算法讲解

弗洛伊德算法(Floyd):

https://www.cnblogs.com/ssyfj/p/9495960.html

 

 

 

 

                 ········

 

7 拓扑排序

 1)拓扑排序介绍

 

 

 2)拓扑排序算法

 

 

 

 

8 关键路径

 

 

 1)关键路径算法原理

 2)关键路径算法

 

 

 

 

 

 

 

 

9 总结

 

Guess you like

Origin www.cnblogs.com/superjishere/p/12318047.html