igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] weak ties / structural holes in Igraph


From: Magnus Thor Torfason
Subject: Re: [igraph] weak ties / structural holes in Igraph
Date: Mon, 26 Sep 2011 14:29:01 -0400
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2

On 9/26/2011 11:43, Gábor Csárdi wrote:
Isn't the simplest to calculate the local transitivity of the
vertices? This is implemented and fast, and for each vertex gives the
density of its ego network, right?

Best,
Gabor

#################################
### Begin code snippet
> n = 10
> g = graph.random(n,4)
> d = data.frame( ego.density=ego.density(g),
+                 transitivity=transitivity(g, type="local") )
> d
   ego.density transitivity
1    0.3000000    0.3000000
2    0.3333333    0.3333333
3    0.3333333    0.3333333
4    0.5000000    0.5000000
5    0.0000000    0.0000000
6    1.0000000    1.0000000
7    0.3000000    0.3000000
8    0.0000000    0.0000000
9    0.3000000    0.3000000
10   0.3333333    0.3333333
>
### End code snippet
#################################

So yes, it seems that in putting together my ego network density function, I just reimplemented transitivity() in a less efficient manner :-)

Thanks for the pointer!

Best,
Magnus



reply via email to

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