I'm loading directed weighted graph from csv file into graph-tool graph
graph. The organization of the input csv file is:
Where the fist two entries of a line identify source and target of an edge
and the third number is the weight of the edge.
Currently I'm using:
g = gt.Graph()
e_weight = g.new_edge_property("float")
f_network = open(in_file_directory+ '/'+network_input, 'r')
reader_network = csv.reader(f_network, delimiter=delimiter)
for edge in reader_network:
e = g.add_edge(int(edge), int(edge))
e_weight[e] = float(edge)
However it takes quite long to load the data (I have network of 10 millions
of nodes). I have tried to make it faster by using g.add_edge_list, but this
works only for unweighted graphs. Any suggestion how to make it faster?