Finding center of undirected, unweighted, cyclical graph.

Topics: algorithm, graph
Apr 21, 2011 at 8:41 AM
Edited Apr 21, 2011 at 9:54 AM

Could anyone inform me as to the optimal algorithm for finding the center vertex for an undirected, unweighted but cyclical graph? My thought so far is to find the spanning tree and then remove leaf nodes until there are at most 2 vertices in the tree; however I am not certain that this algorithm is optimal.

Thank you kindly in advance.