girlscript/winter-of-contributing

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

Hello @Mahi1901,
Thank you for opening an issue. :octocat:
Note - Self-assigns by the original author will be prioritised by mentors manually
To get assigned to this particular issue please use /assign
Check this guide before contributing.

/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.