igraph-help
[Top][All Lists]

[igraph] Re: betweenness and degree correlation

 From: Yong Zou Subject: [igraph] Re: betweenness and degree correlation Date: Thu, 23 Jul 2009 16:27:29 +0200

```Hi Tamas,

It's me again. :-)

I find it is quite hard for me to write the python code back to C. Can
target from my edge list?

num1 += (int)igraph_vector_e(&mydegree, source) *
(int)igraph_vector_e(&mydegree, target);
num2 += (int)igraph_vector_e(&mydegree, source) +
(int)igraph_vector_e(&mydegree, target);
den1 += ?;

num1 /= nEdge;
den1 /= 2.0*nEdge;
num2 = ( num2 / (2.0*nEdge) ) * ( num2 / (2.0*nEdge) );

assR = (num1 - num2) / (den1 - num2);
printf("assortativity coeff. = %lf\n", assR);

> been committed to the 0.6 tree in Launchpad. It is called
> igraph_assortativity_degree.

It seems that I can't install 0.6 on my computer. Here is a short
piece of error message. Furthermore, I couldn't find the
assortativity.c in src.

foreign.c:2735:31: error: foreign-dl-header.h: No such file or directory
foreign.c:2742: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘igraph_i_dl_data’
foreign.c:2783: error: ‘igraph_i_dl_data’ undeclared (first use in
this function)
fo

Thank you very much.
Yong

On Tue, Jun 23, 2009 at 6:03 PM, Tamas Nepusz<address@hidden> wrote:
> Hi Yong,
>
>> Another problem is about the degree-degree correlation, namely, I want
>> to calculate something P(k'|k) which is so called assortativity
>> coefficient. But I'm sorry I couldn't find it somewhere from igraph.
> This is not implemented directly in igraph, but it's fairly simple (at
> least if you are thinking about the assortativity coefficient as defined
> by Newman). This is calculated in Python as follows:
>
> http://snipplr.com/view/9914/calculating-assortativity-coefficient-in-igraph/
>
> I guess it's not too complicated to translate this back to C.
>
> --
> Tamas

```