Simple proof of Kruskal algorithm of prim algorithm

Source: Internet
Author: User

The prim algorithm proves that:

For AI points in the minimum cost spanning tree

Remove the K-bar connected to him

The least connected graph becomes k+1 connected sub-graph

Choose AI points to connect the smallest side of the outside A1 to A2

Must be one side of the smallest tree.

For A1 A2 two points in the minimum cost spanning tree

Delete their k ' edges connected to the outside world

Connect graph becomes K ' + 1 Unicom sub-map

They are connected to the outside world by the smallest side AI to A3

Must be one side of the tree.

........

Follow the steps above to determine the n-1 edge of all n points

Kruskal Proof

The prim algorithm indicates that

A sub-diagram that joins a minimal spanning tree and the smallest edge of the outside must be the edge in the smallest spanning tree

The first edge selected according to the Kruskal algorithm

A1 to A2, the smallest side of the A1 connecting the outside world.

The smallest spanning tree is known by the prim algorithm

Second side A3 (possibly equal to A1 or A2) found by the Kruskal algorithm to A4 (may be equal to A1 or A2)

The smallest spanning tree to which the A3 belongs is connected to the smallest edge of the outside (smaller is either already selected or has been formed with the identified edges)

The smallest spanning tree is known by the prim algorithm

........

Follow the steps above to determine the n-1 edge of all n points

Simple proof of Kruskal algorithm of prim algorithm

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.