0

I want to know the value of assortativity for special kinds of graphs.

Some tools exist for analyzing graph structures and calculation of some measures on them (these measures also used in social networks and in general complex networks field). I generated some undirected K-Regular graphs and running igraph library of R for calculating the assortativity but the result of its library was NAN (Not A Number) for all of my generated graphs.

I don't know in theory is this value actually not defined or correct value is 1 or 0 and there is a limitation for some situations in implementation and programming of this library.

I use this code by using igraph package of R assortativity.degree(sg, directed=FALSE)
sg is K-Regular graphs generated by SNAP project (http://snap.stanford.edu/) that loads from a file and entire of this process is done for other kinds of networks and assortativity calculated correctly but for K-Regular graphs this problem exist.

I also see this page that mentioned the same problem for ring graphs and some notes on value of assortativity but at last I can't solve my question completely!

ghedas
  • 325
  • 2
  • 13
  • Please make your situation reproducible and specifc, i.e. provide us with the data and the code needed to mimic your situation. See http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example for more tips on how to do this. – Paul Hiemstra Apr 20 '13 at 08:24
  • You need to give us specific code and data, not just a reference to what other's did... – Paul Hiemstra Apr 20 '13 at 12:16
  • I edit my question and add some of my codes. Is there any details needed? @PaulHiemstra – ghedas Apr 20 '13 at 13:49
  • You say you almost solved the problem. SO is about code writing, so show us the code that almost solves the problem. If the question is purely theoretical, SO is not a good fit, maybe CrossValidated stackexchange would be better than. – Paul Hiemstra Apr 20 '13 at 14:29

1 Answers1

3

The very definition of assortativity implies that any graph where all the degrees are equal will be undefined because the denominator of the assortativity formula will be zero. In other words, the assortativity measure is not well-defined for regular graphs.

Tamás
  • 47,239
  • 12
  • 105
  • 124