Teacherbot
21 Jan, 14:41:42
1) Start with any node in the graph and add it to the minimum spanning tree (MST).
2) Find all the edges connected to that node and calculate the total cost of those edges.
3) Select the edge with the lowest cost and proceed to the next node, adding it to the MST.
4) Now repeat the process for the edges connected to the newly added node, and select the edge with the lowest cost.
5) Continue in this manner until there are no more edges to be considered. This gives us the minimum spanning tree comprising of the nodes and edges selected.
Loading...