an minimum spanning tree solution that is using the prim algoritme.