igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Leverage centrality implementation in igraph


From: Tamás Nepusz
Subject: Re: [igraph] Leverage centrality implementation in igraph
Date: Wed, 25 Jul 2012 21:49:07 +0200

Hi Alex, 

As Bernie has mentioned, the measure itself is relatively simple to calculate 
and it does not have a significant uptake in the scientific community yet, so I 
don't think that a low-level C implementation of the measure will be added to 
igraph any time soon (unless someone is willing to provide a patch). It is 
relatively easy to calculate using either the R or the Python interface; a 
quick (untested) Python implementation is as follows:

def leverage_centrality(graph):
    k = graph.degree()
    n = graph.vcount()
    result = []
    for i in xrange(n):
        ki = k[i]
        if ki == 0:
            result.append(0.0)
        else:
            result.append(sum((ki-k[j])/(ki+k[j]) for j in graph.neighbors(i)) 
/ ki)
    return result

-- 
T.


On Wednesday, 25 July 2012 at 17:29, Alex Upton wrote:

> 
> Good afternoon,
> 
> I have just recently read a paper discussing leverage centrality, 
> http://www.plosone.org/article/info:doi/10.1371/journal.pone.0012200. The 
> leverage centrality in this paper is defined as a measure of the relationship 
> between the degree of a given node (ki) and the degree of each of its 
> neighbors (kj), averaged over all neighbors (Ni). Therefore, what I would 
> like to do is implement this, and calculate this in igraph. Has anyone had 
> any experience of doing this, or does anyone know how to implement this?
> 
> 
> Kind regards,
> 
> Alex
> 
> --------------------------------------------------------------------------------------------
> Alex Upton, BEng, MRes, PG Cert Business Administration
> 
> PhD Researcher Biomedical Informatics, Signals and Systems 
> School of Electronic, Electrical and Computer Engineering, 
> College of Engineering and Physical Sciences, University of Birmingham
> Edgbaston, Birmingham, B15 2TT, United Kingdom
> 
> Fax: +44 121 4144291 (school general office)
> Email: address@hidden (mailto:address@hidden)
> 
> Personal Web: http://postgrad.eee.bham.ac.uk/uptona/
> --------------------------------------------------------------------------------------------
> _______________________________________________
> igraph-help mailing list
> address@hidden (mailto:address@hidden)
> https://lists.nongnu.org/mailman/listinfo/igraph-help






reply via email to

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