- Implementing Kruskal's algorithm using STL.
- Sort all edges in non-decreasing order of their weight.
- Pick the smallest edge. Check if it forms a cycle with the spanning tree formed so far.
- If cycle is not formed, include this edge. Else, discard it.
- Repeat step #2 until there are (V-1) edges in the spanning tree.
- Use a vector of edges which consist of all the edges in the graph and item of a vector will contain 3 parameters
- source, destination and the cost of an edge
- Use the inbuilt std::sort to sort the edges in the non-decreasing order
- Use Union Find Algorithm to check if it the current edge forms a cycle if it is added in the current MST.