we have no built-in function for this. It does not seem to be too
difficult to implement, though.
Gabor
> _______________________________________________
> igraph-help mailing list
> igrap...@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>
--
Gabor Csardi <csa...@rmki.kfki.hu> MTA KFKI RMKI
_______________________________________________
igraph-help mailing list
igrap...@nongnu.org
https://lists.nongnu.org/mailman/listinfo/igraph-help
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