igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] count neighbourhood (python)


From: Raphael Clifford
Subject: Re: [igraph] count neighbourhood (python)
Date: Sun, 16 Sep 2012 17:07:38 +0100

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]