
14 Sep
2005
14 Sep
'05
11:41 a.m.
Hi, Excuse me for the very trivial question, but I'm new with boost and I'm looking for help. How I can locate a vertex of a graph by the index of the vertex? Thanks a lot in advance, Giulio

14 Sep
14 Sep
2:15 p.m.
On Sep 14, 2005, at 6:41 AM, Giulio Veronesi wrote:
Hi,
Excuse me for the very trivial question, but I'm new with boost and I'm looking for help. How I can locate a vertex of a graph by the index of the vertex?
If your graph is an adjacency_list, you can use vertex(N, g) to get the Nth vertex in the graph g. Otherwise, you can advance a vertex iterator: vertex_iterator vi = vertices(g).first; std::advance(vi, N); vertex_descriptor v = *vi; // v is the Nth vertex Doug
7102
Age (days ago)
7102
Last active (days ago)
1 comments
2 participants
participants (2)
-
Doug Gregor
-
Giulio Veronesi