igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] How to calculate rich-club connectivity?


From: Tamás Nepusz
Subject: Re: [igraph] How to calculate rich-club connectivity?
Date: Mon, 19 Dec 2011 22:24:34 +0100

> I'm trying to find connectivity patterns between rich-club which means that 
> nodes have largest indegree or outdegree.
> 
> I found a function calculating degree distribution but I could not found any 
> function for figuring out rich-clubs and connectivity between rich-clubs.
You haven't mentioned whether you are using igraph from R, Python or C, but 
anyway, extracting a "rich club" should be simple:

1. First, you calculate the degrees of the vertices (using degree() in R, the 
degree() method of the graph object in Python, or igraph_degree in C).

2. Second, you find the indices of the vertices with the top degrees. In R, 
this can be done using sort(degrees, index.return=T) and taking the last part 
of the list; in Python, you can use sorted(range(g.vcount()), 
key=g.degree().__getitem__) and again taking the last part of the list.

3. Third, you extract the subgraph corresponding to the selected indices using 
subgraph() in R, the subgraph() method of the graph object in Python, or 
igraph_subgraph in C.

I have added a Python implementation of the rich club extraction to the wiki 
here:

http://igraph.wikidot.com/python-recipes#toc3

Cheers,
Tamas




reply via email to

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