I have a boost::filtered_graph< Graph_t, boost::keep_all, vertex_predicate >
Say FG is my filtered graph. and v1 is any node for which i want to find all out edges using out_edge_iterators
edge_predicate here is " keep_all "
vertex predicate is some predicate which is used to modify node properties of graph.
In the documentation, it is given:
graph_traits<filtered_graph>::out_edge_iterator
//The type for the iterators returned by out_edges(), which is:
filter_iterator<EdgePredicate, graph_traits<Graph>::out_edge_iterator>
The iterator is a model of MultiPassInputIterator.
now, when i define out_edge_iterators:
out_edge_iterator begin, end;
boost::tie( begin, end) = out_edges ( v1, FG )
What I expect, is the following:
1. It should take into account the edge_predicate provided and filter the edges according to that. basically the begin and end iterators should be filter_iterators based on edge predicate.
2. I dont think vertex_predicate should be called on other node of the edges. for example, suppose v1 has 3 out edges
( v1, v2 ),
(v1, v4),
(v1, v6).
My observation is :
In the process of finding out_edges of v1, the vertex_predicate is being called on the very first opposite node of v1. In above case,
suppose begin --> points to edge (v1, v2), then,
out_edges(v1, G) ---> calls vertex_predicate on **v2**
Why is this the case? Is it because of implementation of out_edges() function which would involve finding adjacent nodes and return the first node found ?
The same case I observe when adjacent_vertices() is called. documentation says it models as out_edge_iterator < edge_predicate , ... > .
I am getting my expected results. but I want to know whether my guess is correct or not ? I am not providing any edge_predicate to filtered-graph as such.
Please suggest.