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

<snip>

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 (http://tinyurl.com/9skck) for more on how to do this.

Aaron


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk