Boost logo

Boost :

From: Christian Sturz (linuxkaffee_at_[hidden])
Date: 2008-02-28 06:33:34


Hi,

> > /usr/include/boost/graph/depth_first_search.hpp:197: error: 'struct
> > boost::bgl_named_params<dfs_time_visitor<main::size_type*>,
> > boost::graph_visitor_t, boost::no_property>' has no member named
> > 'initialize_vertex'
> > dfs.cc:76: instantiated from here
>
> It looks like you're calling a function that takes a visitor type as
> the 2nd parameter. The problem is that the visitor() function is
> probably creating a bgl_named_parameters struct, not a visitor.
> Needless to say, the named parameters structure doesn't have members
> named initialize_vertex() or finish_vertex(), etc. Try chaining the
> named parameters together like this:
>
> visitor(vis).color_map(&color[0]).start_vertex(root)
[start_vertex should be root_vertex]

thank you, this works now. Was a great help for me. ;-)
However, this is not very intuitive because according to the
documentation http://www.boost.org/libs/graph/doc/depth_first_search.html
I would expect 4 arguments for the parameterized version of depth_first_search.

I have another problem with the DFS. In the description it's said that
"once all reachable vertices have been visited, the algorithm selects from any remaining undiscovered vertices and continues the traversal". What I need is a DFS beginning at the root vertex and traversing over all vertices that can be reached from that root vertex. All further remaining vertices not reachable from the root vertex are irrelevant for me. Is there a way to modify depth_first_search to just get the first set of
vertices? Or are there maybe other BGL that would be more suitable for
that?

Thank you.

Christian

-- 
Psst! Geheimtipp: Online Games kostenlos spielen bei den GMX Free Games! 
http://games.entertainment.web.de/de/entertainment/games/free

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