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: anupam sinha
Subject: Re: [igraph] number of links between two vertex in a directed graph
Date: Thu, 18 Mar 2010 23:09:52 +0530

Hi Gabor,
                  To add to whatever has been already asked.
 How can I count and list the number of paths  between every pair of node in a network ? Thanks in advance

Regards,

Anupam

On Thu, Mar 18, 2010 at 7:41 AM, Khanh Nguyen <address@hidden> wrote:
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
>>


_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help





reply via email to

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