igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] number of links between two vertex in a directed graph


From: Khanh Nguyen
Subject: Re: [igraph] number of links between two vertex in a directed graph
Date: Wed, 17 Mar 2010 22:11:34 -0400

Thank you very much. It works wonder.

On Wed, Mar 17, 2010 at 4:44 AM, Gábor Csárdi <address@hidden> wrote:
> Hi, this is probably the fastest way:
>
> no.links <- function(g, from, to) sum(neighbors(g, from)==to)
>
> E.g.:
>
> g <- graph( c(1015, 1017, 959, 959, 991, 991, 1015, 1017, 1015, 1017,
> 3368, 3368) )
> no.links(g, 1015, 1017)
>
> Gabor
>
> On Wed, Mar 17, 2010 at 6:25 AM, Khanh Nguyen <address@hidden> wrote:
>> Hi,
>>
>> How can I get the number of links between two vertex in a directed graph?
>>
>> For instance...
>>
>>> head(E(graph.facebook.walls))
>> Edge sequence:
>>
>> [1] 1015 -> 1017
>> [2]  959 ->  959
>> [3]  991 ->  991
>> [4] 1015 -> 1017
>> [5] 1015 -> 1017
>> [6] 3368 -> 3368
>>
>> in this case, the number of links between 1015 - 1017 is at least 3....
>>
>> Thanks..
>>
>> -k
>>




reply via email to

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