If all the edges have different weights ( that is : there are no two edges with the same weight ) , there is exactly one minimal spanning tree . We can also assign a weight to each edge , which is a number representing how unfavorable it is , and use this to assign a weight to a spanning tree by computing the sum of the weights of the edges in that spanning tree .