Prim in O(V**2) changed.