Hi, I'd like to use depth_first_search to check whether a particular vertex is reachable from the root vertex. Is there a way to stop the search when the vertex is found? In other words, can a visitor be used to cut the search tree? Sorry, if this is a newbie question. Thank you very much in advance for your help. Tobias
There is not a way to stop that is built into depth_first_search, but you can throw and exception from within the visitor, and then catch the exception outside of the call to depth_first_search. On Tue, 15 Jan 2002, tobi_schuele wrote: tobias> Hi, tobias> tobias> I'd like to use depth_first_search to check whether a particular tobias> vertex is reachable from the root vertex. Is there a way to stop the tobias> search when the vertex is found? In other words, can a visitor be used tobias> to cut the search tree? Sorry, if this is a newbie question. Thank you tobias> very much in advance for your help. tobias> tobias> Tobias ---------------------------------------------------------------------- Jeremy Siek http://php.indiana.edu/~jsiek/ Ph.D. Student, Indiana Univ. B'ton email: jsiek@osl.iu.edu C++ Booster (http://www.boost.org) office phone: (812) 855-3608 ----------------------------------------------------------------------
participants (2)
-
Jeremy Siek
-
tobi_schuele