You know you can get the edges, vertices, and property maps as numpy arrays by using the .a method. You should be able to do whatever you need much faster with arrays than dictionaries.
Hi everyone, to compute some functions I needed to loop over a bunch of edges. I realized that the call to property maps seems slow compare to a dictionary. I am a bit surprised since I was told - I am not an expert in python - that a query in a dictionary was already. So I was wondering if I made a mistake in using graph_tool. Following is an example of comparison.
Best,F.
In [3]:In [4]:destination (vertex) (type: long double) _graphml_vertex_id (vertex) (type: string) origin (vertex) (type: long double) _graphml_edge_id (edge) (type: string) speed (edge) (type: long double) name (edge) (type: string) time (edge) (type: long double)In [5]:In [8]:CPU times: user 102 ms, sys: 5 ms, total: 107 ms Wall time: 103 ms CPU times: user 2 ms, sys: 0 ns, total: 2 ms Wall time: 1.94 ms
_______________________________________________
graph-tool mailing list
graph-tool@skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool