Let G = (V, E) be a weighted, connected and undirected graph. Describe an efficient algorithm that decides whether there are exactly 2 different MSTs in G.
The previous question which I already solved was a lot easier: Describe an efficient algorithm that decides whether there is exactly one MST in G.
This is how I solved the latter question:
We run Kruskal algorithm and then color the edges of the new MST in blue and the rest of the edges in red.
Then I used another simple algorithm that we've seen (that uses Kruskal) that find a MST in a graph that contains a maximum number of red edges - which means that it's a MST in the graph G regardless of the edges' color, and every other MST cannot contain more red edges then the MST the algorithm finds.
Now there is exactly one MST iff the algorithm found the same MST (that contains all the blue edges).
The other question here seems a lot more complicated. I've tried using the algorithm described above and also tried to use various other tricks but neither has worked.
By the way, I've heard that there is an algorithm that counts the number of different MSTs in a graph, but it really is an overkill - and I was asked to provide a simple algorithm.
I would appreciate any help, Thanks