Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] simple problem: how to detect connections in a dag?
From: Olaf Krzikalla (olaf.krzikalla_at_[hidden])
Date: 2010-01-06 10:22:54


Hi,

Vladimir Prus schrieb:
>>> in that
>>> case, breadth_first_search or depth_first_search would find the path.
>> The problem here is that we need to stop the search once we've found a
>> connection. But neither BFS visitors nor DFS visitors seems to give us a
>> chance to cancel the search. The discover_vertex visitor could have this
>> ability (I slightly remember that I had the problem to cancel a search
>> in BGL some years ago and I wasn't able to solve it by then too).
>
> You can throw from discover_vertex visitor.
Somehow I was afraid of that answer. Is an early stop such an
exceptional use case that exceptions are the proper solution?
Or should I consider this rather a limitation of BGL (rendering it
useless for us as I will not introduce exceptions as part of the normal
execution path). I wonder if this problem occurs so infrequent that
there is no real built-in solution.

Best regards
Olaf Krzikalla


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net