Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost graph add vertex
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2009-01-14 08:54:09


>
> Just as in add_edge(1,2,graph) you get to choose the numbers which
> represent the vertex is it possible to do the same with add_vertex where i
> actually choose the vertex number. I guess the syntax might be like
> add_vertex(3,graph)

Directly using integers as vertex or edge descriptors not a good idea - it
only works for some kinds of graphs. Also, add_vertex(3, graph) is probably
not setting an index for the new vertex since vertex indices - those values
indicate the position of the index within a vector (assuming your graph
stores vertices in a vector).

Again, I'm not sure what problem this is addressing - it's hard to see what
you're trying to do without a little code.

Andrew Sutton
andrew.n.sutton_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