Boost Users :
From: Rui Carvalho (rui.carvalho_at_[hidden])
Date: 2005-05-09 15:59:24
Thanks for the suggestions -I think I can build a simple iterator because
the vertex list is vecS.
BTW, what I'm trying to do is calculate the clustering coefficient (Watts &
Strogatz) of each vertex in a directed network -feel free to point my
stupidity if I'm missing something obvious.
All the best,
> -----Original Message-----
> From: Doug Gregor [mailto:dgregor_at_[hidden]]
> Sent: 09 May 2005 15:10
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] [BGL] Iterate through neighbour vertices
> On May 9, 2005, at 5:54 AM, Rui Carvalho wrote:
> > Hi,
> > I have a directed graph (vecS, vecS, bidirectionalS) and I'm trying to
> > iterate through the neighbour vertices of a vertex u. When using
> > for (tie(ai0,ai0_end) = adjacent_vertices(u,g); ai0 != ai0_end; ++ai0)
> > the code goes only through the out vertices of u. Is there a way to
> > iterate
> > through all the neighbouring vertices in one loop (i.e. through both
> > the out
> > and in vertices of u)?
> I don't know of a good way to do this with the BGL. You'll need to
> either build some kind of smart iterator adaptor that traverses
> out_edges then in_edges, or have two separate loops.
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