Boost logo

Boost Users :

Subject: [Boost-users] [Graph] initialize_vertex change vertex color (visitor)
From: The Maschine (justthemaschine_at_[hidden])
Date: 2014-01-13 06:38:02


Hi all,

I would like to build a visitor (for dikstra) with the initialise_vertex
acting as 'colour map' modifier.
I want to exclude some vertices from the search based on a condition.
So I want to set some vertices 'black' in the init part of the algorithm.

class dijkstra_2step : public boost::default_dijkstra_visitor

{

public:

    dijkstra_2step(std::vector<Weight> dists, double threshold):
distances(dists), threshold(threshold) {}

// THIS PART IS NOT CORRECT!!!! //

    void initialize_vertex(boost::graph_traits
<unGraph>::vertex_descriptor u, const unGraph& g){

        if( distances[u] > threshold ) color[u] = black; // ??????

    }

//////////

    std::vector<Weight> distances;

    double threshold;

};

Any help for the above visitor? How to I access the colour?

I couldn't find something online.

Thanks



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