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.

332 CHAPTER 16. DYNAMICAL NETWORKS I: MODELINGas a “speaker” or a “listener.” The probability actually depends on how popular a nodeis. Specifically, <strong>the</strong> original version tends <strong>to</strong> choose higher-degree nodes as a speakermore <strong>of</strong>ten, while <strong>the</strong> reversed version tends <strong>to</strong> choose higher-degree nodes as a listenermore <strong>of</strong>ten. This is because <strong>of</strong> <strong>the</strong> famous friendship paradox, a counter-intuitive factfirst reported by sociologist Scott Feld in <strong>the</strong> 1990s [68], which is that a r<strong>and</strong>omly selectedneighbor <strong>of</strong> a r<strong>and</strong>omly selected node tends <strong>to</strong> have a larger-than-average degree.Therefore, it is expected that <strong>the</strong> original version <strong>of</strong> <strong>the</strong> voter model would promote homogenization<strong>of</strong> opinions as it gives more speaking time <strong>to</strong> <strong>the</strong> popular nodes, while <strong>the</strong>reversed version would give an equal chance <strong>of</strong> speech <strong>to</strong> everyone so <strong>the</strong> opinion homogenizationwould be much slower, <strong>and</strong> <strong>the</strong> edge-based version would be somewherein between. We can check <strong>the</strong>se predictions by computer simulations.The good news is that <strong>the</strong> simulation code <strong>of</strong> <strong>the</strong> voter model is much simpler than tha<strong>to</strong>f <strong>the</strong> majority rule network model, because <strong>of</strong> <strong>the</strong> asynchrony <strong>of</strong> state updating. We nolonger need <strong>to</strong> use two separate data structures; we can keep modifying just one Graphobject directly. Here is a sample code for <strong>the</strong> original “pull” version <strong>of</strong> <strong>the</strong> voter model,again on <strong>the</strong> Karate Club graph:Code 16.5: voter-model.pyimport matplotlibmatplotlib.use(’TkAgg’)from pylab import *import networkx as nximport r<strong>and</strong>om as rddef initialize():global gg = nx.karate_club_graph()g.pos = nx.spring_layout(g)for i in g.nodes_iter():g.node[i][’state’] = 1 if r<strong>and</strong>om() < .5 else 0def observe():global gcla()nx.draw(g, cmap = cm.binary, vmin = 0, vmax = 1,node_color = [g.node[i][’state’] for i in g.nodes_iter()],pos = g.pos)

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

Saved successfully!

Ooh no, something went wrong!