15.08.2015 Views

Introduction to the Modeling and Analysis of Complex Systems

introduction-to-the-modeling-and-analysis-of-complex-systems-sayama-pdf

introduction-to-the-modeling-and-analysis-of-complex-systems-sayama-pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

17.6. ASSORTATIVITY 397Assortativity (positive assortativity) The tendency for nodes <strong>to</strong> connect <strong>to</strong> o<strong>the</strong>rnodes with similar properties within a network.Disassortativity (negative assortativity) The tendency for nodes <strong>to</strong> connect <strong>to</strong> o<strong>the</strong>rnodes with dissimilar properties within a network.Assortativity coefficient∑(i,j)∈Er =(f(i) − ¯f 1 )(f(j) − ¯f 2 )√ ∑(i,j)∈E (f(i) − ¯f√ ∑1 ) 2 (i,j)∈E (f(j) − ¯f(17.33)2 ) 2where E is <strong>the</strong> set <strong>of</strong> directed edges (undirected edges should appear twice inE in two directions), <strong>and</strong>∑(i,j)∈E¯f 1 =f(i) ∑(i,j)∈E, ¯f2 =f(j). (17.34)|E||E|The assortativity coefficient is a Pearson correlation coefficient <strong>of</strong> some nodeproperty f between pairs <strong>of</strong> connected nodes. Positive coefficients imply assortativity,while negative ones imply disassortativity.If <strong>the</strong> measured property is a node degree (i.e., f = deg), this is called <strong>the</strong>degree assortativity coefficient. For directed networks, each <strong>of</strong> ¯f 1 <strong>and</strong> ¯f 2 can beei<strong>the</strong>r in-degree or out-degree, so <strong>the</strong>re are four different degree assortativitiesyou can measure: in-in, in-out, out-in, <strong>and</strong> out-out.Let’s look at some example. Here is how <strong>to</strong> draw a degree-degree scatter plot:Code 17.19: degree-correlation.pyfrom pylab import *import networkx as nxn = 1000ba = nx.barabasi_albert_graph(n, 5)xdata = []ydata = []for i, j in ba.edges_iter():xdata.append(ba.degree(i)); ydata.append(ba.degree(j))

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!