Boost logo

Boost :

Subject: Re: [boost] [BGL] How to stopping prematurely a graph exploration
From: Cosimo Calabrese (cosimo.calabrese_at_[hidden])
Date: 2009-08-06 06:00:10


Cosimo Calabrese ha scritto:
> Hi to all,
>
> I'm searching for a good method to stopping prematurely a graph
> exploration, e.g. when I've just founded and explored a particular vertex.
>
> I think I've to create a visitor to which passing the particular vertex,
> but I don't know how to configure it.
>
> A very brutal method is to wrap the exploration function in a try-catch
> block, and then throw an exception in the examine_vertex funtion. I want
> to believe that there's a more elegant method than this...
>

I've thought to create a visitor with a queue parameter and a vertex
parameter, in which I pass the Dijkstra's queue and the particular
vertexDescriptor. When the examine_vertex() function analyzes the
particular vertex, I empty the queue, and the algorithm terminates.

What do you think about this?

Best regards,
Cosimo Calabrese.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk