Boost logo

Boost Users :

Subject: [Boost-users] To find adjacent vertices using Boost Graph....
From: Amanullah Yasin (amanyasin_at_[hidden])
Date: 2009-05-20 12:47:16


Hi,
Dear All,

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

 2 are 4 5 6
3 are 5 6 7

I will be thankful to you.

Regards

Amanullah YASIN
Master2 (ECD)
Ecole Polytechnique
Université de Nantes, France.
Mob# 06 47 62 89 96
Fix # 02 72 00 26 45
amanyasin_at_[hidden]



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