- #1
evinda
Gold Member
MHB
- 3,836
- 0
Hello! (Wave)
It is given as input an undirected graph $G=(V,E)$, weights of edges $w_e$ and a subset $U$ of the vertices.
The output should be the minimum spanning tree at which the vertices of the set $U$ are leaves.
(The tree could also have leaves from the nodes of the set $V-U$).
I want to run an algorithm for the above problem that runs in time $O(|E| \cdot \log|V|)$.
So we couldn't apply Borůvka's algorithm or Prim's algorithm, because we would have to call them $|V|$ times.. Or am I wrong?
If it is like that, what else could we do? (Thinking)
It is given as input an undirected graph $G=(V,E)$, weights of edges $w_e$ and a subset $U$ of the vertices.
The output should be the minimum spanning tree at which the vertices of the set $U$ are leaves.
(The tree could also have leaves from the nodes of the set $V-U$).
I want to run an algorithm for the above problem that runs in time $O(|E| \cdot \log|V|)$.
So we couldn't apply Borůvka's algorithm or Prim's algorithm, because we would have to call them $|V|$ times.. Or am I wrong?
If it is like that, what else could we do? (Thinking)