On 29.07.2016 09:57, m jadidi wrote:
> Hi,
>
> I was wondering if there is any way to assign vertex properties while adding 
> edges to the graph. for example using "add_edge_list" I can assign edge 
> properties but later I have to iterate through all vertices again to assign 
> their properties.
>
> I know this is not a problem  when the vertex property is of the type "int" 
> or "float" because then one can use "vprop.a =  values", but in case of 
> "string" and "object" this method doesn't work
>
> What would be the best/fastest way to handle this situation.


You can create new property maps with initialized values of any kind with

    p = g.new_vertex_property("string", vals=values)

Best,
Tiago

-- 
Tiago de Paula Peixoto <[email protected]>

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
graph-tool mailing list
[email protected]
https://lists.skewed.de/mailman/listinfo/graph-tool

Reply via email to