Add prims algorithm for finding mininum/maximum spanning tree, necessary to construct r-vines