# Finding minimum spanning tree with O(|V|)

Given an undirected weighted graph $G(V,E)$, where the number of edges is $|V|+10$, how can I find the minimum spanning tree of $G$ in $O(|V|)$?

Kruskal's algorithm is out of the question, since sorting alone is $O(|V|\log |V|)$, so I thought maybe using Prim's algorithm with minimum binary heap, but still - every iteration will cost $\log |V|$ for updating vertices keys in the heap, so altogether it's $|V|\log |V|$.
I know that the key here is to use the fact that $|E|=|V|+10$, so I start thinking maybe removing the 11 edges with the biggest weights, as long as the graph stays connected, but that's obviously a bad idea since it'll - again - require sorting.
I just can't figure it out. Any help would be greatly appreciated.

• Why should you have to sort, to find $11$ edges? The only tricky part is to ignore bridges, but that should be linear too. Commented Dec 23, 2013 at 20:44
• So, I need to find the $11$ biggest edges? But nothing says that none of the $11$ biggest edges will be in the spanning tree... It is possible that one of them will be, so throwing them away just like that (as long as they're not bridges) is not optimal. Commented Dec 23, 2013 at 23:03
• Look for "finding a cycle in an undirected graph". Commented Dec 23, 2013 at 23:55
• Finding all cycles in the graph, and removing the maximum edge from each cycle. would that work? Commented Dec 24, 2013 at 13:48