title: Find a spanning tree with maximum number of edges with same weight
body: <p>Here's the problem.  </p>
  
  <p>A weighted undirected connected graph G is given. The weights are constant. The task is to come up with an algorithm that would find the total weight of a spanning tree for G that fulfills these two conditions (<em>ordered by priority</em>):</p>
  
  <ul>
  <li>The spanning tree has to have <strong>maximum number of edges with the same weight</strong> (the actual repeated weight value is irrelevant);</li>
  <li><strong>The total spanning tree weight should be minimized.</strong> That means, for example, that the spanning tree T1 with weight 120 that has at most 4 edges with the same weight (and the weight of each of those four is 15) should be preferred over the spanning tree T2 with weight 140 that has at most 4 edges with the same weight (and the weight of each of those four is 8).</li>
  </ul>
  
  <p>I've been stuck on that for quite a while now. I've already implemented Boruvka's MST search algorithm for the graph, and now I'm not sure whether I should perform any operations after MST is found, or it's better to modify MST-search algorithm itself.</p>
  
  <p>Any suggestions welcome!</p>