Boost logo

Boost Users :

From: Michael Fawcett (michael.fawcett_at_[hidden])
Date: 2008-08-07 12:03:38


On Thu, Aug 7, 2008 at 11:41 AM, Martin Mann
<mmann_at_[hidden]> wrote:
>
> Hi,
>
> I am using BFS to find the shortest path between two nodes as suggested in
> the documentation for unweighted graphs (or all weights == 1).
>
> I have written a visitor and can now access a shortest path from the start
> vertex to the vertex of interest.
>
> ====================================================================
> My question is: HOW to stop further BFS traversal of the graph?
> ====================================================================
>
> Is there a possibility e.g. by emptying the vertex queue (e.g. by the
> visitor)? Or some other, more elegant way to do?

Throw an exception. See this thread for my performance comparisons.

http://thread.gmane.org/gmane.comp.lib.boost.devel/171423/focus=171596

--Michael Fawcett


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