Spanning tree (Prim and Kruskal).