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.

16.2. SIMULATING DYNAMICS ON NETWORKS 339def update():global g, nextgfor i in g.nodes_iter():ci = g.node[i][’state’]nextg.node[i][’state’] = ci + alpha * ( \sum(g.node[j][’state’] for j in g.neighbors(i)) \- ci * g.degree(i)) * Dtg, nextg = nextg, gAnd <strong>the</strong>n we can simulate a nice smooth diffusion process on a network, as shown inFig. 16.5, where continuous node states are represented by shades <strong>of</strong> gray. You can seethat <strong>the</strong> diffusion makes <strong>the</strong> entire network converge <strong>to</strong> a homogeneous configuration with<strong>the</strong> average node state (around 0.5, or half gray) everywhere.Figure 16.5: Visual output <strong>of</strong> Code 16.7. Time flows from left <strong>to</strong> right.Exercise 16.6 This diffusion model conserves <strong>the</strong> sum <strong>of</strong> <strong>the</strong> node states. Confirmthis by revising <strong>the</strong> code <strong>to</strong> measure <strong>the</strong> sum <strong>of</strong> <strong>the</strong> node states during <strong>the</strong>simulation.Exercise 16.7 Simulate a diffusion process on each <strong>of</strong> <strong>the</strong> following network<strong>to</strong>pologies, <strong>and</strong> <strong>the</strong>n discuss how <strong>the</strong> network <strong>to</strong>pology affects <strong>the</strong> diffusion onit. For example, does it make diffusion faster or slower?• r<strong>and</strong>om graph

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

Saved successfully!

Ooh no, something went wrong!