Apply Prim's algorithm (#709)