
7 Oct
2009
7 Oct
'09
11:52 a.m.
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@gmail.com