igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] assortativity for small world graph


From: Tamas Nepusz
Subject: Re: [igraph] assortativity for small world graph
Date: Tue, 25 Aug 2009 15:54:49 +0100
User-agent: Mutt/1.5.17 (2007-11-01)

Hi Simone,

> gSW = Graph.Lattice([1,g.vcount()], nei=sum(g.degree())/g.vcount(), 
> directed=True, mutual=False);
Note that the nei=... option is not supported yet in the Python
interface, so this is equivalent to a ring with g.vcount() vertices.
Also note that the Python code snippet you use uses the total degree, so
there's no need to make your graph directed as the assortativity
calculation will treat it as if it were undirected.

> It seems that den1 and num2 are equal...
It can happen easily if all the vertices have degree 1. In that case,
you end up with 0/0 in the definition of assortativity. Feel free to
catch the exception and treat the assortativity as zero in these cases.

-- 
Tamas




reply via email to

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