|
Boost Users : |
From: Marcio Paim de Aquino (marcio.paim_at_[hidden])
Date: 2006-03-01 09:30:27
Michael Kettner escreveu:
>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 mailing list
>Boost-users_at_[hidden]
>http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>
>
I'm a newbie, so the manual is not much elucidative. I would like to see
some code and an
explanation if possible. I would like to have a good understanding on
how to write a visitor
code, so maybe I could find a solution myself.
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