Spanning Tree Using Prims Algorithm
Mahi1901 opened this issue · 3 comments
Description
Prims algorithm is a greedy algorithm that is applied to find the minimum spanning tree of a graph. Graph are to be weighted, connected, and undirected. A set of edges that connects two set of vertices in a graph is called cut in graph theory. Essentially, at each step of Prim’s algorithm, we've to seek out a cut (of two sets, one contains the vertices already included in MST and other contains remainder of the vertices), pick the minimum weight edge from the cut and include this vertex to MST Set (the set that contains already included vertices). The working behind Prim’s algorithm is straightforward , a spanning tree means all vertices must be connected. So both the disjoint subsets (discussed above) of vertices must be connected to form a Spanning Tree. In turn they must be connected with the minimum weight edge to make it a Minimum Spanning Tree.
Domain
C/CPP
Type of Contribution
Documentation
Code of Conduct
- I follow Contributing Guidelines & Code of conduct of this project.
/assign
This issue has been assigned to @Mahi1901!
It will become unassigned if it isn't closed within 12 days. A maintainer can also add the pinned label to prevent it from being unassigned.