Generalized minimum spanning treces