igraph-help
[Top][All Lists]
Advanced

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

[igraph] local average transitivity


From: sudeep s
Subject: [igraph] local average transitivity
Date: Thu, 28 Feb 2013 15:59:52 +0800 (SGT)

Hi all,
I was calculating local average transitivity for my graph and I found somthing a bit odd, calculating the average transitivity for the whole graph and local average transitivity for a set of vertices gave me the same value, 

> g2 <- erdos.renyi.game(1000, 10/1000)
> transitivity(g2,type="average")
[1] 0.009935484
transitivity(g2,type="localaverageundirected",vids=head(V(g2)))
[1] 0.009935484
Now shouldn't the second transitivity value be  
> mean(transitivity(g2,type="local",vids=head(V(g2))))
[1] 0.008994709
What I have also seen is that
local average transitivity gave the same value for varying number of nodes   
> transitivity(g2,type="localaverageundirected",vids=head(V(g2),n=100))
[1] 0.009935484

> transitivity(g2,type="localaverageundirected",vids=head(V(g2),n=50))
[1] 0.009935484

After checking the R code for function transitivity I saw that  transitivity types   "average", "localaverage" and   "localaverageundirected" is calling the same external method   

transitivity
function (graph, type = c("undirected", "global", "globalundirected",
    "localundirected", "local", "average", "localaverage", "localaverageundirected",
    "barrat", "weighted"), vids = NULL, weights = NULL, isolates = c("NaN",
    "zero"))
{

    type <- igraph.match.arg(type)
    type <- switch(type, undirected = 0, global = 0, globalundirected = 0,
        localundirected = 1, local = 1, average = 2, localaverage = 2,
        localaverageundirected = 2, barrat = 3, weighted = 3)
 if (type == 2) {
        .Call("R_igraph_transitivity_avglocal_undirected", graph,
            isolates, PACKAGE = "igraph")
    }
}

Is this a possible bug in R igraph ?
I found  this same  thing with igraph package versions
igraph_0.6.4 and igraph_0.6.3

Thank you,

Regards,
Sudeep.

reply via email to

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