Boost logo

Boost Users :

From: Steve M. Robbins (steven.robbins_at_[hidden])
Date: 2002-09-18 14:00:51


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