2 Aug
2010
2 Aug
'10
2:46 p.m.
Hi all, I have a graph where I start at a certain vertex and want to find the next undiscovered vertex at a maximum distance of 5 or so from the source vertex. Now I am running breadth_first_search() using a record_distances() visitor and I get the distances to all other vertices (say 10 000 of them) in my graph. This makes my algorithm slow, since I only need to know about vertices at a max distance of 5-6, not all of them. Is there a way of interrupting the algorithm when a certain predicate function supplied by me evaluates to true? (e.g. max distance reached, or a new interesting/valid vertex found, etc) thanks, AW