Redirecting to Prim's algorithm