Hi,

> It simply does a breadth-first search form the starting vertex, and
> the igraph data structure ensures fast traversal of the graph.
>

Thanks. I suppose for order > 2 it might be worth using (sparse)
matrix multiplication, depending on the parameters involved..

>>
>> [g2.subgraph(g2.neighborhood(v, order = 2)).ecount() for v in g.vs]
>>
>> Is there a better/faster igraph way?
>
> I think this is probably the best way. At the C level there is a
> function that gives these graphs directly, but it does essentially the
> same as you are doing.
>
OK. Thanks.

Raphael

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

Reply via email to