I probably need to give a bit clearer description for what I need to do. I would like to build a visitor that accesses the colour_map of a specific vertex. The idea is to 'hide' some vertices from the search completely. I have found that the possible solution might be through the 'initialize_vertex()' or do you think some other trick is better? Best On Mon, Jan 13, 2014 at 11:38 AM, The Maschine < justthemaschine@googlemail.com> wrote:
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