Boost logo

Boost Users :

From: Soth (soth1985_at_[hidden])
Date: 2007-10-02 09:57:45


Soth wrote:
>
> I cannot figure out how to create a color map for depth first search, i`m
> using bundled properties and the following type as graph.
> adjacency_list<listS,setS,bidirectionalS,WorldNode> world_graph_t;
>
> right now i`m trying to make it like this, but i get 50 errors and
> cannot deduce what my error is.
>
> template<class VisitorT>
> THOR_INLINE void DepthFirstSearch(const VisitorT& vis, const
> vertex_descriptor& start)
> {
> using namespace boost;
> std::vector<default_color_type> color_vec( num_vertices(graph) );
> depth_first_search(graph, visitor(vis),
> color_map(make_iterator_property_map(color_vec.begin(),get(vertex_color,graph))),
> start);
> }
>
>
>
> ---------------------------------
>
> Вы уже с Yahoo!? Испытайте обновленную и улучшенную. Yahoo! Почту!
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>

I figured out that i can create property maps this way

template<class VisitorT>
                THOR_INLINE void DepthFirstSearchImpl(const VisitorT& vis, const
vertex_descriptor& start, const boost::vecS& tag)
                {
                        using namespace boost;
                        //this approach works when vecS is used when vertexlist=vecS
                        vector_property_map<default_color_type> color_vec( num_vertices(graph) );
                        depth_first_search(graph, vis, color_vec, start);
                }
                
                template<class VisitorT, class TagT>
                THOR_INLINE void DepthFirstSearchImpl(const VisitorT& vis, const
vertex_descriptor& start, const TagT& tag)
                {
                        using namespace boost;
                        std::map<vertex_descriptor, boost::default_color_type> c_m;
                        depth_first_search(graph, vis, make_assoc_property_map(c_m), start);
                }

-- 
View this message in context: http://www.nabble.com/-boost%3A%3Agraph--creating-an-external-map-for-depth_first_search-tf4551019.html#a12999392
Sent from the Boost - Users mailing list archive at Nabble.com.

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