Optimal Trees in Weighted Graphs