Arbitrary vertex indices in an edge lsit
I have a dataset in which the indeces of the vertices are arbitrary (i.e. the highest index is much higher than the number of vertices) If I use the add_edge_list( ) function to construct the graph there are vertices for each index between 0 and the highest occurring index in my dataset. Is there any way to avoid all these unnecessary vertices? Thank you very much -- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
On 04.09.2015 21:17, janoshoener wrote:
I have a dataset in which the indeces of the vertices are arbitrary (i.e. the highest index is much higher than the number of vertices) If I use the add_edge_list( ) function to construct the graph there are vertices for each index between 0 and the highest occurring index in my dataset. Is there any way to avoid all these unnecessary vertices?
This is possible, but only in the version in git. You would do simply g.add_edge_list(edges, hashed=True). In the current version, you have to do the mapping yourself. Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
participants (2)
-
janoshoener -
Tiago de Paula Peixoto