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.

390CHAPTER 17. DYNAMICAL NETWORKS II: ANALYSIS OF NETWORK TOPOLOGIES(array([ 1., 11., 6., 6., 0., 3., 2., 0., 0., 0., 1., 1., 0., 1., 0.,0., 0., 0., 1., 1.]), array([ 1. , 1.8, 2.6, 3.4, 4.2, 5. , 5.8,6.6, 7.4, 8.2, 9. , 9.8, 10.6, 11.4, 12.2, 13. , 13.8, 14.6, 15.4,16.2, 17. ]), )>>> show()The result is shown in Fig. 17.8.1210864200 2 4 6 8 10 12 14 16 18Figure 17.8: Visual output <strong>of</strong> Code 17.13.You can also obtain <strong>the</strong> actual degree distribution P (k) as follows:Code 17.14:>>> nx.degree_his<strong>to</strong>gram(g)[0, 1, 11, 6, 6, 3, 2, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1]This list contains <strong>the</strong> value <strong>of</strong> (unnormalized) P (k) for k = 0, 1, . . . , k max , in this order. Forlarger networks, it is <strong>of</strong>ten more useful <strong>to</strong> plot a normalized degree his<strong>to</strong>gram list in alog-log scale:Code 17.15: degree-distributions-loglog.pyfrom pylab import *import networkx as nxn = 1000

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

Saved successfully!

Ooh no, something went wrong!