18 Sep
2002
18 Sep
'02
7 p.m.
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