I would like to count the number of vertices within a 2 hop distance
of each node in a large sparse graph.  I see there is a function which
one could call with neighborhood size(vertices=g.vs, order=2). What
method is used to do the calculation?

A classic way to do it would be to represent the graph as a sparse
matrix, square it using a clever sparse matrix multiplication
algorithm and count the number of elements in each row that are
non-negative.  I am wondering how this would compare to the
implemented method in igraph.  Can igraph make a sparse matrix that
could be fed directly into
http://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csr_matrix.html#scipy.sparse.csr_matrix
for example?

Raphael

_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to