|
From: | Tamas Nepusz |
Subject: | Re: [igraph] vertex ids and function igraph_vcount(const igraph_t *graph) |
Date: | Fri, 7 Aug 2009 22:23:26 +0100 |
Hi Christian,
Hello everybody if you have a graph with six edges like this:
[...]
How many memory is reserved for the vertex vector? --> 4 or 30000000 positions?
30000000. igraph graphs have numeric vertex IDs starting from zero and they are always continuous. The code you sent creates a graph for you that has 30000000 vertices and most of them are isolated (they have no edges). If you need only 4, you have to create a mapping from your numeric IDs to the range [0; 3], remap the vertex IDs in the edges vector to this range and possibly add the original numeric IDs as a numeric attribute to the vertices if you need them later. For more information on using attributes from the C core, see the following page:
http://igraph.sourceforge.net/doc/html/ch09s02.html Regards, -- Tamas
[Prev in Thread] | Current Thread | [Next in Thread] |