minimum spanning trees in python