Connected Components in Graph Theory

asi123
Messages
254
Reaction score
0

Homework Statement



Hey guys,

I have this question.

Given a tree T = (V , F), find an algorithm which finds u in V, so in the graph T = (V \ {u} , F) the size of each connected component is |V| / 2 at most. What is the complexity?

Homework Equations





The Attempt at a Solution



I need to split this tree down the middle somehow, any idea?

Thanks a lot.

Assaf
 
Physics news on Phys.org
Can you think of a useful number (or pair of numbers, perhaps) you could associate with each vertex?
 
Ok, so I did the following:

I woluld first use BFS algorithm (it has to be run for each verticle) for computng shortest distances between all pairs of verticles. Then for each verticle V find Vm - the largest distance to any other verticles amongs the data retuirned form BFS. Then, the verticles with the smallest Vm are the one in the graph center.

It comes down to O(V^2), any thing better then that?

Thanks a lot.

Assaf.
 
My method doesn't beat O(v^2), but it's easy to describe. Remove all vertices degree 1. Repeat until only 1 or 2 vertices left. Pick any of those.
 
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...
Back
Top