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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

17.5. DEGREE DISTRIBUTION 3891.00.8L / L0C / C00.60.40.20.010 -4 10 -3 10 -2 10 -1 10 0pFigure 17.7: Visual output <strong>of</strong> Code 17.12.17.5 Degree DistributionAno<strong>the</strong>r local <strong>to</strong>pological property that can be measured locally is, as we discussed already,<strong>the</strong> degree <strong>of</strong> a node. But if we collect <strong>the</strong>m all for <strong>the</strong> whole network <strong>and</strong> represent<strong>the</strong>m as a distribution, it will give us ano<strong>the</strong>r important piece <strong>of</strong> information about how <strong>the</strong>network is structured:A degree distribution <strong>of</strong> a network is a probability distribution∣∣ { i | deg(i) = k} P (k) =, (17.28)ni.e., <strong>the</strong> probability for a node <strong>to</strong> have degree k.The degree distribution <strong>of</strong> a network can be obtained <strong>and</strong> visualized as follows:Code 17.13:>>> from pylab import *>>> import networkx as nx>>> g = nx.karate_club_graph()>>> hist(g.degree().values(), bins = 20)

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

Saved successfully!

Ooh no, something went wrong!