mauryahimanshu / Must-know-Algorithms-for-competitive-coding

For Hacktoberfest 2020 Contribution
https://hacktoberfest.digitalocean.com/
2 stars 12 forks source link

Prim's Algorithm #15

Closed Prashuk156 closed 3 years ago

Prashuk156 commented 3 years ago

Aim : To find the Minimum Spanning Tree of a graph using prim's algorithm Difficulty : Medium

Minimum Spanning Tree: Given a connected and undirected graph, a spanning tree of that graph is a subgraph that is a tree and connects all the vertices together. A single graph can have many different spanning trees. A minimum spanning tree (MST) or minimum weight spanning tree for a weighted, connected and undirected graph is a spanning tree with weight less than or equal to the weight of every other spanning tree. The weight of a spanning tree is the sum of weights given to each edge of the spanning tree.