What is MST? MST is the Most Small Tree. It should be the minimum spanning Tree. It is not very clear that the MST is the minimum spanning Tree (hereinafter referred to as the MST ), when we look at the algorithm of the Minimum Spanning Tree, we often have descriptions of this nature, for example, in history, the most classic Prim Algorithm and Kruskal Algorithm are Algorithm calculated based on this property. The MST attribute declaration is as follows:
Minimum Spanning Tree properties:G = (V, E) is a connected network, and U is a real subset of vertex set V. If (u, v) is an entry in G, "one endpoint is in U (for example: u, U), and the other endpoint is not in U (for example: v, V-U ), and (u, v) has the minimum weight, then there must be a minimum spanning tree of G including this edge (u, v ).
There is not much online information about the process of proof of this nature. Even if there is, it is not very comprehensive or the process is not detailed enough. It took me a long time to figure it out. In fact, it is very simple, let's take a look at how I proved it:
In order to facilitate the following proof process, make some conventions in advance:
① Regard vertices in set U as red vertices
2. the vertices in the V-U are regarded as blue vertices.
③ The edges connecting the red and blue dots are regarded as orange edges.
④ The Orange edge with the smallest weight is called the light edge (that is, the edge with the least weight)
Therefore, the edges (u, v) described in the MST can be referred to as the light edges. For example:
The inverse proof method is used to prove the correctness of the MST nature. Assume that no smallest Spanning Tree in G contains a light edge (u, v ). If T is a minimum spanning tree of G, it does not include this light edge.
Because T contains the connectivity graph of all vertices in G, T must have a path P from the red point u to the Blue Point v, and the path P must contain an orange edge (U ', v ') connects the red vertex set and the blue vertex set. Otherwise, the u and v cannot be connected. Let's assume thatU-a-u '-V'-vSee the figure below for a path like this:
When the light side (u, v) is added to the tree T, the light side and P constitute a loop. After removing the purple edge (U', V'), the loop is also eliminated, and a new life tree T' can be obtained '. As follows:
Obviously, the difference between t' and T is that t' replaces the orange edge (U', v ') with a lighter edge (u, v) with a higher weight in T '). Because the weight of (U', v ') cannot be smaller than that of (u, v), we can see from the principle of the reverse verification method that we have explained in the prerequisites, the smallest edge in all orange edges is called a light edge, because (u, v) is a light edge already assumed. Therefore, there must be the following relationship:
W (u, v) ≤ w (U', V ')Therefore, w (t') = w (T) + w (u, v)-w (U', V') ≤ w (T)
Therefore, T' is also a Minimum Spanning Tree of G, but it contains (u, v). This is in conflict with assumptions. Therefore, the MST property is true!
Conversion from vertex (u, v), because the tree is connected graph, so there must be other sides connected to the vertex set U and V-U, and such an edge must only one, otherwise it will form a loop, because the vertex set U and the V-U inside each vertex is also connected, you can see the painting will know. So if we now put the light edge (u, v) into this tree, then the formation of the loop, then we will remove the original Unicom U and V-U side, the resulting tree is less costly than the original Minimum Spanning Tree, because the edge (u, v) is the edge that connects the two sets of points with the smallest weight. Therefore, this new tree is the smallest spanning tree, but it contains edges (u, v). Therefore, it is in conflict with assumptions and the conclusion is true. In fact, we need to prove that for two sets of points, the edge with the smallest weight value (u, v), if the minimum spanning tree of the graph does not include this edge, then this tree will
Not the Minimum Spanning Tree.