Re: [graph-tool] efficiency of graph creation

2015-04-27 Thread Krister
Thanks for the quick response Thiago! In this code all the edges and vertices are created by graph-tool and the result is something much faster... is this the best I can do? It's somewhat annoying to have to keep track of the vertices that will be created like this: def

Re: [graph-tool] Average calculation from vectordouble property

2015-04-27 Thread Tiago de Paula Peixoto
On 27.04.2015 16:29, Tiago de Paula Peixoto wrote: On 27.04.2015 00:31, desert_rain wrote: Hi, I am using graph-tool for my research, thanks for creating graph-tool. I need to calculate average values from vertex and edge properties. Property types are vectordouble. When I use the

Re: [graph-tool] efficiency of graph creation

2015-04-27 Thread thekswenson
I posted code with missing lines... here is the good code: #!/usr/bin/python Create graphs in networkx and graph-tool. import networkx as nx from graph_tool.all import * import igraph from itertools import combinations def graph_tool_create(): Create a graph_tool graph given a list of

[graph-tool] efficiency of graph creation

2015-04-27 Thread thekswenson
I've been using networkx to simply create a graph and check the connected components. The bottleneck of the operation is the creation of the edges. I've heard that graph-tool is very efficient so I've replaces the code with a graph-tool graph. To my surprise, the creation of a graph-tool graph

Re: [graph-tool] Average calculation from vectordouble property

2015-04-27 Thread Tiago de Paula Peixoto
On 27.04.2015 00:31, desert_rain wrote: Hi, I am using graph-tool for my research, thanks for creating graph-tool. I need to calculate average values from vertex and edge properties. Property types are vectordouble. When I use the edge_average function, program gives 'RuntimeError'. How

Re: [graph-tool] efficiency of graph creation

2015-04-27 Thread ...
I solved this once by making a NoDupesGraph where you could add edges with just the names of vertices . class NoDupesGraph(Graph): '''Add nodes without worrying if it is a duplicate. Add edges without worrying if nodes exist ''' def __init__(self,*args,**kwargs):

Re: [graph-tool] Average calculation from vectordouble property

2015-04-27 Thread desert_rain
Thank you alot for this quick fix. You are awesome! -- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/Average-calculation-from-vector-double-property-tp4026107p4026115.html Sent from the Main discussion list for the graph-tool project