Algorithm to find how many edges weighted x exist in every MST of graph

113 Views Asked by At

Given an undirected graph $G(V, E)$ with a weight function $f$ and a ceratin weight $x$, I need to find how many edges with weight $x$ appear in every minimum spanning tree of $G$.

any ideas on how to solve this problem? I think that somehow it's necessary to prioritize the edges with weight $x$ over other edges.

Thanks.

1

There are 1 best solutions below

0
On

Every MST has the same multiset of edge weights. Thus, you only need to compute a single MST and return the multiplicity of $x$ in it.