Hi Alireza,

Thank you so much for your reply.
I'm not sure whether concave hull of the community would be the solution
here or not , (by what do we mean by boundary ).
here I meant that one vertex is in one community and the, other one is in
the other community, and I would like to calculate the number of the edges
between these two vertices for each community.

Regards,
Fatemeh

ᐧ

On Thu, Nov 27, 2014 at 10:25 AM, Alireza Norouzzadeh <
[email protected]> wrote:

> Hi!
>
> On solution is to find the concave hull of the community. Then count the
> number of edges.
> This is not in igraph. But there are solutions in c++, R as far as i know.
>
> Regards
> Alireza
>
>
>> Date: Tue, 25 Nov 2014 23:52:52 +0330
>> From: Fatemeh a <[email protected]>
>> To: Help for igraph users <[email protected]>
>> Subject: [igraph] calculating the number of edges on the boundary of S
>> Message-ID:
>>         <CABzwCXNNrWvKqY=
>> [email protected]>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>>
>> Hi,
>>
>> I would appreciate if some one could help me to speed up this piece of
>> code
>>  :
>>
>> what I am trying to do is to calculate the number of edges on the boundary
>> of community S but it is really slow.
>>
>> numberofedge<-function(graph,community)
>> {
>> cs <- data.frame(combn(unique(membership(community)),2)) #----considering
>> a
>> combination of communities two by two
>> cx <- sapply(cs, function(x) {   #calculating edges in between two
>> communities
>>     es<-E(graph)[V(graph)[membership(community)==x[1]] %--%
>>               V(graph)[membership(community)==x[2]]]
>>     length(es)})
>> y=cbind(t(cs),cx)
>> i=1
>> CS=array( data=0,dim = length(unique(membership(community))))
>> while (i<length(y[,1])+1){    # calculating the edges on the boundary for
>> each community
>>  CS[y[i,1]]=CS[y[i,1]]+y[i,3]
>>   CS[y[i,2]]=CS[y[i,2]]+y[i,3]
>>   i=i+1
>> }
>>
>>
>> --
>> regards
>> F..A
>>
>>
> _______________________________________________
> igraph-help mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>
>


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

Reply via email to