Boost logo

Boost :

From: Aaron Windsor (aaron.windsor_at_[hidden])
Date: 2005-11-18 22:22:58

On 11/18/05, Alexander Ivanov <amivanov_at_[hidden]> wrote:
> Hello,
> I'm experiencing the same behavior with following graph:
> typedef boost::adjacency_list<setS, setS, directedS, ...> graph_t;
> and then boost::depth_first_search would not take following visitor:
> template<GraphT>
> struct cycle_detector {
> // ...
> template <typename EdgeT, typename GraphT>
> void back_edge(EdgeT E, GraphT& G) { /*...*/}
> };
> replacing VertexList param with vecS fixes the compilation error.
> Could anyone confirm that is a known issue or otherwise what we're doing wrong?
> --Alex


This isn't a bug - if you use the default color map in
depth_first_search, you must also supply a vertex index map (property
map that maps vertices into the range 0..num_vertices(g) - 1.) If you
use a std::vector for your vertex list, the vertex index map is
supplied for you. Otherwise, you'll have to create your own. See the
BGL FAQ, #5 ( for more on how to do this.


Boost list run by bdawes at, gregod at, cpdaniel at, john at