Used prim get_mst_edges method to factor out map function