Boost logo

Boost :

From: Joel Young (jdy_at_[hidden])
Date: 2003-08-14 12:12:16

From: Jonathan de Halleux <dehalleux_at_[hidden]>
> I have a tree built with the BGL. I want to find the root of the tree.
> Has anybody an idea on the algorithm I should be using ? thks

Assuming your graph is bidirectional and has a single root, then you
should just be able to pick any node, pick any parent thereof, repeat
until you deadend. that is the root.



Boost list run by bdawes at, gregod at, cpdaniel at, john at