Hi,
I am computing a weight for each edge, in a graph of some million nodes and
about 50 mil edges. Initially, it was doing 25000 edges per minute, so it
should have finished processing in about 30+ hours. Now I check the server
for results after more than 72 hours, and the process is still running, but
very slowly, doing less than 1000 edges per minute.
Is there anything I am doing wrong, or what could be the reason for such a
slowdown?
I list here the code:
def compute_exclusivities(g):
count = 0
excl = g.new_edge_property("double")
g.edge_properties["Exclusivity"] = excl
edges = g.get_edges([g.edge_properties["label_id"]])
for edge in edges:
edges_of_head = g.get_out_edges(edge[0],
[g.edge_properties["label_id"]])
count_edges_ofhead_sametype = len(np.where(np.where(edges_of_head ==
edge[2])[1] == 2)[0])
edges_of_tail = g.get_in_edges(edge[1],
[g.edge_properties["label_id"]])
count_edges_oftail_sametype = len(np.where(np.where(edges_of_tail ==
edge[2])[1] == 2)[0])
excl[g.edge(edge[0], edge[1])] = 1 / (count_edges_ofhead_sametype +
count_edges_oftail_sametype - 1)
count = count + 1
if count % 1000 == 0:
print(count, " exclusivities computed")
Thanks,
Ioana