Abstract

The total weight of the minimum spanning is the smallest in the connected graph. It can be used to solve many practical problems in urban life. Prims algorithm and Kruskals algorithm are greedy algorithms for solving the minimum spanning tree problem. But they make greedy choices in different ways. The paper focuses on two greedy algorithms for solving the minimum spanning tree problem. The author will evaluate each algorithms complexity and determine their most suitable condition as well. The author compares the running process of the two algorithms and analyzes the relationship between their algorithm complexity and the number of edges, which can describe the sparsity of the graphs. The result shows that Kruskals complexity is related to the number of edges, so it is better for sparse graphs. Prims complexity is related to the number of vertices, so it is better at analyzing connected graphs with lots of vertices, that is, dense graphs. As a consequence, Prims algorithm is better for dense graphs.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.