Minimum spanning the shortest path VS

1, from the Article 0 Prime algorithm is continuously generated during edge of the n-side,
first randomly selected from a point (access to the set) as a start, a first step to identify the point with this minimum edge distance (Note: this edge must be in inside the final spanning tree, this side is not necessarily the smallest side in the figure);
in this case there is an edge in the spanning tree, two vertices (in which a visited);
a minimum while looking for the new node is connected;
DIS [ i] and is connected to the node i in FIG. found current minimum edge;
total n-th point, a minimum spanning tree needs (n-1) edges, can only find an edge, for an (n-1 ) times.
Why keep new dis []? Because the choice of the side of the spanning tree is based on dis [] to choose and to choose the minimum, it must ensure
a minimum of dis [i] is
why here with a new dis []? Because before all the sides are determined to be spanning tree edge, so just need to find the only guarantee of the current node dis side [] to a minimum.

to be continued…

VS shortest path algorithm minimum spanning a large collection of

Guess you like

Origin blog.csdn.net/dongjian2/article/details/90743548