Boost logo

Boost Users :

Subject: Re: [Boost-users] [Graph] initialize_vertex change vertex color (visitor)
From: alex (alexhighviz_at_[hidden])
Date: 2014-01-14 09:49:10


>> 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)


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