igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] dyads and triads census


From: Gabor Csardi
Subject: Re: [igraph] dyads and triads census
Date: Tue, 2 Oct 2007 10:33:35 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

On Sun, Sep 30, 2007 at 09:21:26AM -0500, address@hidden wrote:
> I'd love to see this feature.
> By the way, the translation from igraph motif number to the standard  
> notion is:
> 0   003
> 1   012
> 2   021U
> 3   102
> 4   021C
> 5   111D
> 6   021D
> 7   030T
> 8   120D
> 9   111U
> 10  201
> 11  030C
> 12  120C
> 13  120U
> 14  210
> 15  300
> just for reference.

Peter, thanks, this agrees with the translation i
included in the triad.census function below. Good to be
double-checked. :)

I added it to the ever-growing todo list.

G.
 
[...]
> >triad.census <- function(graph) {
> >  motifs <- graph.motifs(graph)
> >  vc <- vcount(graph)
> >  ec <- ecount(graph)
> >  iso <- sum(degree(graph)==0)
> >  motifs[c(2,4)] <- motif24(graph)
> >  motifs[1] <- vc*(vc-1)*(vc-2)/6 - sum(motifs)
> >  names(motifs) <- c("003", "012", "021U", "102", "021C", "111D",  
> >"021D", "030T",
> >                     "120D", "111U", "201", "030C", "120C", "120U",  
> >"210", "300")
> >  motifs[ c("003","012","102","021D","021U","021C","111D","111U",
> >            "030T","030C","201","120D","120U","120C","210","300")]
> >}
[...]

-- 
Csardi Gabor <address@hidden>    MTA RMKI, ELTE TTK




reply via email to

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