Boost logo

Boost Users :

Subject: Re: [Boost-users] DAG Graph Search
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2009-10-09 14:34:21


On Fri, 9 Oct 2009, Dan Bailey wrote:

> 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?

Your graph only has two vertices and you are trying to add edges to
vertices other than 0 and 1. Try changing to a four-vertex graph to avoid
the memory overflow problem.

-- Jeremiah Willcock


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