Boost logo

Boost Users :

From: Chris Russell (cdr_at_[hidden])
Date: 2002-09-18 15:10:10


Thanks Steve. I guess one possible issue would be that the vertex/edge
properties used by the algorithm to maintain state during processing would
be left in some intermediate state. Not an issue if the graph is built
expressly for the purpose of running the algorithm, collecting the answer,
and is subsequently discarded. I'm guessing that most of the algorithms
initialize the properties they rely on to a known state before starting but
I haven't got that far yet.

"Steve M. Robbins" <steven.robbins_at_[hidden]> wrote in message
news:20020918190051.GA16536_at_nyongwa.montreal.qc.ca...
> On Wed, Sep 18, 2002 at 11:42:14AM -0400, Chris Russell wrote:
> > Is there a way to abort an algorithm while it's processing? Can I throw
an
> > exception out of a visitor method? I have a case where I need the
algorithm
> > to crunch on a large graph until some condition dependent on property
data
> > is reached. If and when the condition is met, I would like to skip the
> > processing of the remaining vertices/edges and save the cycles. Does
using
> > exceptions sound like a reasonable approach?
>
> I use that technique to abort the Dijkstra shortest path search when I
find my
> goal node. It works fine, as far as I can tell, but I'd be interested to
> learn if there is a better way.
>
> -S
>


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