To find adjacent vertices using Boost Graph....

Hi,

Dear All,

I am beginner in boost graph library. In the graph of nodes (e.g. 1 , 2, 3, 4, 5, 6 , 7........). I want to iterate to the adjacent nodes of node x. For this i am using adjacent_vertices(v, g), which returns std::pair<adjacency_iterator, adjacency_iterator>

for (i = 1; i <= n; i++){

tie(eo, eo_end) = adjacent_vertices( vertex( i-1, graph), graph);
}

Please guide me how i can use the adjacency_iterator to access the neighbourhood of node x ?
e.g. graph is a
1 ---- 2 3 4 5
2 ---- 4 5 6
3 ---- 5 6 7

so, neighbourhood of 1 are 2 3 4 5
neighbourhood of 2 are 4 5 6
neighbourhood of 3 are 5 6 7


I will be thankful to you.
Topic archived. No new replies allowed.