how to use add_edge_list() and then add isolated vertices?
Hi, I am using add_edge_list and it returns a vector map of vertices it has added, but how do I add in isolated vertices that have no edges (otherwise they would have been put in there by add_edge_list). The vector map of vertices is a mapping between integers -> string vertex names. When I add in isolated vertices, they have string names that somehow have to be incorporated into the vmap that is returned by add_edge_list. Any help appreciated. Thanks!
On 14.12.2016 01:43, reckoner wrote:
Hi,
I am using add_edge_list and it returns a vector map of vertices it has added, but how do I add in isolated vertices that have no edges (otherwise they would have been put in there by add_edge_list). The vector map of vertices is a mapping between integers -> string vertex names. When I add in isolated vertices, they have string names that somehow have to be incorporated into the vmap that is returned by add_edge_list.
You can just add them later via a call to Graph.add_vertex(). You can include their names to the property map in the usual way. -- Tiago de Paula Peixoto <tiago@skewed.de>
participants (2)
-
reckoner -
Tiago de Paula Peixoto