Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL]Standard Breadth First Visitor
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2009-01-07 10:00:58


>
> I need to supply it with an appropriate visitor which does the exploring
> of adjacent nodes and a property map for the colouring.
> Setting up those two causes me trouble. I simply fail at making sense of
> the documentation.
>

Creating a visitor is easy. Creating exterior property maps can be a bit of
a pain.

struct my_visitor : default_bfs_visitor
{
  my_color_map colors;

  template <typename Graph, typename Vertex>
  discover_vertex(Graph& g, Vertex v)
  { /* Your code here */ }
};

// calling it
queue<graph_traits<Graph>::vertex_descriptor> q;
breadth_first_visit(g, root, q, my_visitor(), my_colors);

Andrew Sutton
andrew.n.sutton_at_[hidden]



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