Figure?
Undirected graph, directed graph
how to describe a chart?
Adjacency table method, adjacency matrix
there may be unified as there are pictures to the directed graph, and not
whether it is a directed graph or no can follow have expressed to the directed graph
adjacency table method:
adjacency list method, and adjacency matrix is the most classic of two representations, in fact there are many representations
Topological sorting
Give you a view of
an example, our compiler compile a file, it is the sort carried out in accordance with the topology
if that file must first compile the compiler B E, D file, the file needs to be compiled to compile C D A document compiled file need to build the B, C file
to be topologically sorted must be a directed graph, and there is no loop,
the minimum spanning tree algorithm
minimum spanning tree algorithm, a certain application is no phase diagram
has two algorithms, one algorithm is the K P algorithm
K algorithm:
P algorithm:
Each time unlock a node will be introducing many new edge, looking smallest weight edge in all these edges inside to see if the node his connection is not already unlocked, if it has been unlocked, then to find the weight of the second small side
The difference between P and K algorithm algorithm:
K algorithm to use disjoint-set, because thinkers K algorithm is that the collections and collections merge so they need to set and check
P algorithm does not require a disjoint-set, is a collection of thoughts and merging individual point, a point and a heavy weight of the side connected by nodes unlocked