Theoretically completed Prim and Kruskals