
On Mon, 26 Apr 2010, Line Blander Reinhardt wrote:
Hi all I need to make a filtered graph for each color. I have a graph where the edges are assigned a color (there are many colours).
I want to make a filtered graph (for each colour) given a colour. I am a little lost with the filtered graph and edge predicates and do not know how to make one with a colour and a colour-edge map. In the examples I have found it is only the map that is needed in the edgepredicate. I have made something like ...
template
struct same_edge_colour { same_edge_colour(): t_colour(){ } same_edge_colour(Colour a, EdgeColourMap m) : t_colour(a),m_colours(m){ } template <typename Edge> bool operator()(const Edge& e) const { return boost::get(m_colours,e)==t_colour; } Tag t_colour; EdgeAgentMap m_colours; }; I am not able to make my filter and the filtered graph. Can someone help me?? Tell me if you need more information.
Do you just need to turn a color map into an edge predicate? In that case, you might just want to copy-and-paste the definition of property_map_filter (from boost/graph/filtered_graph.hpp) and edit it to check the edge's color. -- Jeremiah Willcock