Boost logo

Boost Users :

From: Michael Kettner (kettner_at_[hidden])
Date: 2006-03-01 08:54:00


Hi Marcio!

On Wednesday 29 March 2006 14:43, Marcio Paim de Aquino wrote:
> Hello all,
>
> does anyone know how to make a custom dijkstra visitor that ends the
> algorithm when
> it finds the path between two especified vertexes?

You might read the manual. This is from
        http://www.boost.org/libs/graph/doc/faq.html

How do I perform an early exit from an algorithm such as BFS?

 Create a visitor that throws an exception when you want to cut off the
search, then put your call to breadth_first_search inside of an appropriate
try/catch block. This strikes many programmers as a misuse of exceptions,
however, much thought was put into the decision to have exceptions has the
preferred way to exit early. See boost email discussions for more details.

Regards,
 Michael

> Thanks,
>
> Marcio


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