Adding label to vertices

--------- Mensagem encaminhada ---------

attachment.html (11.7 KB)

Dear Rafael,

>> In graphml, ids are not graph data. If your source uses node ids for
>> data you should fix it and use <key>/<data> instead (see 'Additional
>> Data' in <;
>> <;\). Node ids are
>> for internal parsing use and are not guaranteed to be preserved.

This is not quite right. If the node/edge ids are not in the canonical
format, they are imported as property maps when the graph is loaded.

The property maps can be accessed as:





Ni! You'd access them as internal property maps, in your case:

g.vp["label"] and g.ep["weight"]

But as Tiago pointed out, graph-tool does preserve the ids as property maps in case you used them to store graph data.

The advantage of using the proper format is that it will work the same with any software, that it will work for non-unique properties, that you can store multiple properties, and also declare their types.




attachment.html (15.8 KB)