Re: [Boost-users] [BGL] Dijkstra Shortest Paths
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
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@lists.boost.org 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.
participants (2)
-
Marcio Paim de Aquino
-
Michael Kettner