Boost logo

Boost Users :

Subject: Re: [Boost-users] DAG Graph Search
From: Dan Bailey (drb_at_[hidden])
Date: 2009-10-09 13:38:20


I'm having a few problems getting the depth_first_visit to work at all.
I've been through the examples and can't find anything useful, here's
what I'm currently trying:

    #include <boost/graph/breadth_first_search.hpp>

    using namespace boost;

    typedef adjacency_list<vecS, vecS, directedS> Graph;

    Graph graph(2);
   
    add_edge(1, 2, graph);
    add_edge(2, 3, graph);
   
    depth_first_visit(graph, 0, dfs_visitor<>(),
color_map(get(vertex_color, Graph)));

Can you make any suggestion as to why this might not work?

Thanks,
Dan

Jeremiah Willcock wrote:
> Could you please try:
>
> depth_first_visit(
> g,
> your_start_vertex,
> boost::topo_sort_visitor<YourOutputIterator>(your_output_iterator),
> color);
>
> (with color as a color map for your graph set to all white)? That
> should match what topological sort does but starting at a single
> vertex rather than all roots.
>
> -- Jeremiah Willcock
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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