Data Structure-graph (updating)

Source: Internet
Author: User

I. minimum Spanning Tree: returns a tree T in a given undirected graph G, giving the tree edge in graph G and minimizing the sum of edge weights of the entire tree.

Core Idea of algorithms: greedy

1. kru.pdf algorithm (greedy side)

(1) Sort all edges in ascending order by edge weight;

(2) test all edges from small to large by edge weight. If the two vertices connected to the current test edge are not in the same connected block, add the test edge to the current minimal spanning tree. Otherwise, the edge is discarded;

(3) execute Step 2 until the number of edges in the Minimum Spanning Tree is equal to the sum of vertices minus 1 or ends after all edges are tested.

If the number of edges of the Minimum Spanning Tree is smaller than the total number of vertices minus 1, the graph is not connected.

 

Data Structure-graph (updating)

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.