|
Boost Users : |
Subject: Re: [Boost-users] [BGL] premature termination in dijkstra using visitor
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2009-10-07 07:52:22
> > Are you compiling in debug mode? It can cause dramatic slowdowns with
> > the BGL.
>
> No, I use full optimization with g++ version 4.3: "CXXFLAGS=-O3
> -Wno-deprecated" is in my Makefile. I also noticed that when I
> explicitely use .visitor(default_dijkstra_visitor) or my derived class
> without the "void finish_vertex(Vertex u, Graph g)" no harm is done.
>
> In the header files I found the macro BOOST_GRAPH_EVENT_STUB being
> applied to the default_bfs_visitor. Do I need to apply it to my derived
> class as well?
>
I see the problem... You're passing your graph by value to the visitor
function, meaning you're making a copy of the graph every time you visit a
vertex. That should certainly account for the increased time :)
Andrew Sutton
andrew.n.sutton_at_[hidden]
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