Generalized minimum spanning trees