Label propagation

User 197 | 5/6/2014, 2:38:57 PM

I have a related question concerning line 73 : If the vertex with id other_vid doesn't exist before, is it created?

And if yes is it possible to specify a label for it ?

The is there a method to get a vertex or an edge thanks to its id ?


User 6 | 5/6/2014, 3:12:41 PM

Yes, add_edge() will create both end points in case the other node does not exist. You will need to add a label for it explicitly in the input file. (Unless it is OK to have a default label and in that case you can simply initialize the constructor to have a default label to all unspecified nodes)

User 197 | 5/6/2014, 3:39:56 PM

Thank you! Just to be sure if I understand well. With an input file like :

1 Alabel 3 6 8 9 2 Blabel 12 3 3 A_label 5 6

Then the vertex with id 3 is created at the first line, and at the third line is it label updated?

So in general (not speaking about this particular case of label propagation fonction) there is no way to get a particular vertex by it's id to be able to modify its data for example?

User 6 | 5/6/2014, 4:44:15 PM

There are several ways to do it, one of the is transformvertices() see for example this code: which selects a subset of vertices and operates on them.