Better way to count edges in neighborhood?

User 512 | 10/14/2015, 5:15:51 PM

I need to find the number of edges in level-1 neighbor for every node in graph. Currently my code is below:

g=gl.SGraph().addedges(sf,srcfield='src', dstfield='dst') egoedge=[] for node in g.getvertices()['__id']: egoedge.append(g.getneighborhood(ids=node,radius=1,fullsubgraph=True).summary()['num_edges'])

But this runs really slow on big graph. Is there any better way to do this?

No Comments