prim_minimum_spanning_tree crashes