Hi, On 06/02/2011 05:04 PM, Håvard Wahl Kongsgård wrote:
Hi, I have quickly explored the documentation. So I am sorry if I have overlooked something essential.
I use a graph file exported from gephi (xml file(graphml))
</node> <node id="672712520"> <data key="label">672712520</data> <data key="size">10.0</data> <data key="r">153</data> <data key="g">153</data> <data key="b">153</data> <data key="x">25781.25</data> <data key="y">14798.744</data> </node>
However, the the node id object is not listed as a property map (in my case it's not the same as the label for all nodes) Is it possible to access this value?
The id of a vertex is not interpreted to be a property. This is simply used internally in the graphml format to differentiate between vertices. In case the file uses "canonical" indexes (indexes go from n0 to nN-1), then the ids correspond to the vertex index used in graph-tool, otherwise the ids are not visible after the graph is loaded. If you want the ids to be visible, you have to mirror them as a an actual property.
Second, what is the optimal method to find the vertice number for a known property value(ID or label)?
There is a find_vertex() function available, which does what you want, but it is O(N) (in C++). If you want to do it faster, you have to build your own dictionary... Cheers, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>