1
votes

I'm wondering how to go about solving this problem.

I'm given a graph G = (V,E). This is a connected undirected weighted graph.
The graph consists of a spanning tree and one additional edge.
How would I come up with an algorithm that would compute the MST of the graph in n = |V| time complexity.
I was thinking of Kruskal's Algorithm but it wouldn't meet the time complexity requirement.

1

1 Answers

2
votes

A spanning tree plus one edge makes exactly one cycle. Find the cycle using depth-first search, and then remove its heaviest edge.