add: prims algorithm