Add Prim's algorithm