find an algorithm to find MST in linear time while each edge has the same weight

1.2k Views Asked by At

I have been disscussing this problem with a lot of my friends . However no solution has been found. let G= w is a weight function for each e in E w(e)=1 find MST of G in O(|V|+|E|)

thanks

1

There are 1 best solutions below

0
On BEST ANSWER

If every edge has weight $1$, then every spanning tree of $G$ has the same weight: $\lvert V\rvert-1$. So, all that you actually have to do here is find any $O(\lvert V\rvert+\lvert E\rvert)$-time algorithm for finding ANY spanning tree for $G$.

For instance: breadth-first search can be used to do this, with worst-case performance $O(\lvert V\rvert+\lvert E\rvert)$.