[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] clustering coefficients for bipartite networks
From: |
Simone Gabbriellini |
Subject: |
Re: [igraph] clustering coefficients for bipartite networks |
Date: |
Tue, 1 Feb 2011 20:15:48 +0100 |
Hi Tamas,
I have come to this solution but I don't know if I can consider it a fast one:
def CCBN(self):
for u in self.g.vs(type=0):
ccdot = []
for v in g.vs(type=0):
unei = g.neighbors(u)
vnei = g.neighbors(v)
if len(set(unei) & set(vnei)) > 0:
ccdot.append(len(set(unei) & set(vnei)) / len(list(set(unei
+ vnei))))
u['ccdot'] = [float(sum(ccdot)) / len(ccdot) if len(ccdot) > 0 else
0]
for u in g.vs(type=1):
ccdot = []
for v in g.vs(type=0):
unei = g.neighbors(u)
vnei = g.neighbors(v)
if len(set(unei) & set(vnei)) > 0:
ccdot.append(len(set(unei) & set(vnei)) / len(list(set(unei
+ vnei))))
u['ccdot'] = [float(sum(ccdot)) / len(ccdot) if len(ccdot) > 0 else
0]
what do you think?
best,
Simone
- Re: [igraph] clustering coefficients for bipartite networks, Simone Gabbriellini, 2011/02/01
- Re: [igraph] clustering coefficients for bipartite networks, Simone Gabbriellini, 2011/02/01
- Re: [igraph] clustering coefficients for bipartite networks, Tamás Nepusz, 2011/02/01
- Re: [igraph] clustering coefficients for bipartite networks,
Simone Gabbriellini <=
- Re: [igraph] clustering coefficients for bipartite networks, Tamás Nepusz, 2011/02/01
- Re: [igraph] clustering coefficients for bipartite networks, Simone Gabbriellini, 2011/02/02
- Re: [igraph] clustering coefficients for bipartite networks, Tamas Nepusz, 2011/02/02
- Re: [igraph] clustering coefficients for bipartite networks, jordi torrents, 2011/02/23
- Re: [igraph] clustering coefficients for bipartite networks, jordi torrents, 2011/02/24
- Re: [igraph] clustering coefficients for bipartite networks, Tamas Nepusz, 2011/02/24
- Re: [igraph] clustering coefficients for bipartite networks, jordi torrents, 2011/02/24
- Re: [igraph] clustering coefficients for bipartite networks, Simone Gabbriellini, 2011/02/26