
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.
The algorithm initializes the color map to white AFTER calling initialize_vertex. So your strategy won't work. Perhaps using filtered graph is a better option? If you wish to persevere with the current strategy, you could try to skip the initialization by using the dijkstra_shortest_path_no_init function, but be careful about also initializing the distance map and predecessor map yourself. Best wishes, Alex template <class Graph, class SourceInputIter, class DijkstraVisitor, class PredecessorMap, class DistanceMap, class WeightMap, class IndexMap, class Compare, class Combine, class DistZero, class ColorMap> inline void dijkstra_shortest_paths_no_init (const Graph& g, SourceInputIter s_begin, SourceInputIter s_end, PredecessorMap predecessor, DistanceMap distance, WeightMap weight, IndexMap index_map, Compare compare, Combine combine, DistZero zero, DijkstraVisitor vis, ColorMap color)