There are two algorithms which is Kruskal and Prim's algorithm.