# Connected Components in Graph Theory

1. Mar 1, 2013

### asi123

1. The problem statement, all variables and given/known data

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?

2. Relevant equations

3. The attempt at a solution

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

Thanks a lot.

Assaf

2. Mar 1, 2013

### haruspex

Can you think of a useful number (or pair of numbers, perhaps) you could associate with each vertex?

3. Mar 2, 2013

### asi123

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.

4. Mar 2, 2013

### haruspex

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.