Updated the prim algorithm definition