[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] graph density on bipartite networks
From: |
Simone Gabbriellini |
Subject: |
Re: [igraph] graph density on bipartite networks |
Date: |
Tue, 26 Oct 2010 16:22:34 +0200 |
Hi Gabor,
thanks, yes the parentheses were missing...
I am still on that paper, trying to reproduce the single mode centralization
measures as the authors describe them, in order to capture the salient
properties of the 2mode data without reducing to one-mode. For the degree
centralization, I have:
n0<-length(V(g)[type==FALSE])
n1<-length(V(g)[type==TRUE])
V(g)$degree<-degree(g)
maxn0Deg<-max(V(g)$degree [V(g)$type==FALSE])
maxn1Deg<-max(V(g)$degree [V(g)$type==TRUE])
n0centralization <- sum(maxUsersDeg - V(g)$degree [V(g)$type==FALSE]) / ((n1 -
1) * (n0 - 1))
n1centralization <- sum(maxResDeg - V(g)$degree [V(g)$type==TRUE]) / ((n1 - 1)
* (n0 - 1))
I am now trying to build single mode centralization for closeness and
betweenness, but it looks a bit tricky...
best,
simone
Il giorno 26/ott/2010, alle ore 09.40, Gábor Csárdi ha scritto:
> Hi Simone,
>
> On Mon, Oct 25, 2010 at 9:56 PM, Simone Gabbriellini
> <address@hidden> wrote:
>> Hello List,
>>
>> I've found a possible issue in igraph regarding density for bipartite
>> networks. According to this paper:
>>
>> Borgatti, S. P. and Everett, M. G. (1997). Network Analysis of 2-mode Data.
>> Social Networks, 19(3):243–269.
>>
>> "the standard denominators are clearly not appropriate for 2-mode data,
>> since no ties are possible within vertex sets. The maximum number of ties
>> possible occurs when every vertex in one set is connected to every vertex in
>> the other. If the vertex sets are of size ni and no then this amounts to
>> ni*no edges in the undirected case and 2*ni*no in the directed case"
>>
>> What do you think about this? I guess density for bipartite graph should be
>> calculated according to something like:
>>
>> ecount(g) / length(V(g)[type==FALSE]) * length(V(g)[type==TRUE])
>
> yes, except that some parens are misssing. I think you want
>
> ecount(g) / (length(V(g)[type==FALSE]) * length(V(g)[type==TRUE]))
>
> Here is a function that works for directed networks as well:
>
> density.bipartite <- function(graph) {
> if (is.directed(graph)) {
> ecount(graph) / sum(V(graph)$type) / sum(!V(graph)$type) / 2.0
> } else {
> ecount(graph) / sum(V(graph)$type) / sum(!V(graph)$type)
> }
> }
>
> Best,
> Gabor
>
>> best,
>> Simone
>> _______________________________________________
>> igraph-help mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/igraph-help
>>
>
>
>
> --
> Gabor Csardi <address@hidden> UNIL DGM
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help