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: Gábor Csárdi
Subject: Re: [igraph] number of links between two vertex in a directed graph
Date: Thu, 18 Mar 2010 20:39:33 +0100

Anupam,

check out the get.all.shortest.paths() function.

Best,
Gabor

On Thu, Mar 18, 2010 at 6:39 PM, anupam sinha <address@hidden> wrote:
> 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
>
>
>
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>



-- 
Gabor Csardi <address@hidden>     UNIL DGM




reply via email to

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