Minimum spanning tree search algorithms Prim's algorithm with 2-heap Kruskal's algorithm on trees with nodes rank and compression of paths