igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Joint Membership in Cohesive.blocks


From: Richard Benton
Subject: Re: [igraph] Joint Membership in Cohesive.blocks
Date: Sat, 15 Nov 2014 14:24:35 -0500

Thanks for that. Here is the updated version:

#loop over the matrix#
for (b in seq(from=1, to=length(bl))){
for (i in seq(from=1, to=18)){
  for (j in seq(from=1, to=18)){
    if(i%in%bl[[b]] & j%in%bl[[b]] & cohesionmat[i,j] < co[b]) cohesionmat[i,j]<-co[b] else next   
    }
  }  
}

On Sat, Nov 15, 2014 at 2:00 PM, Gábor Csárdi <address@hidden> wrote:
Nice! Thanks for sharing!

On Sat, Nov 15, 2014 at 1:17 PM, Richard Benton
<address@hidden> wrote:
[...]
> #loop over the matrix#
> for (b in seq(from=1, to=length(bl))){
> for (i in seq(from=1, to=18)){
>   for (j in seq(from=1, to=18)){
>     if(i%in%bl[[b]] & j%in%bl[[b]]) cohesionmat[i,j]<-co[b] else next

Here you also need to check that cohesionmat[i,j] is smaller than
co[b]. It might happen that a block with smaller cohesion is listed
later. (I am actually not completely sure, because I forgot how I
implemented it, but it is better to be on the defensive side, anyway.)

Gabor

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


reply via email to

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