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
_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help