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.

402CHAPTER 17. DYNAMICAL NETWORKS II: ANALYSIS OF NETWORK TOPOLOGIESThe modularity <strong>of</strong> a given set <strong>of</strong> communities in a network is defined as follows [78]:Q = |E in| − 〈|E in |〉|E|(17.35)Here, |E| is <strong>the</strong> number <strong>of</strong> edges, |E in | is <strong>the</strong> number <strong>of</strong> within-community edges (i.e.,those that don’t cross boundaries between communities), <strong>and</strong> 〈|E in |〉 is <strong>the</strong> expectednumber <strong>of</strong> within-community edges if <strong>the</strong> <strong>to</strong>pology were purely r<strong>and</strong>om. The subtraction<strong>of</strong> 〈|E in |〉 on <strong>the</strong> numera<strong>to</strong>r penalizes trivial community structure, such as considering<strong>the</strong> entire network a single community that would trivially maximize |E in |.The Louvain method finds <strong>the</strong> optimal community structure that maximizes <strong>the</strong> modularityin <strong>the</strong> following steps:1. Initially, each node is assigned <strong>to</strong> its own community where <strong>the</strong> node itself is <strong>the</strong>only community member. Therefore <strong>the</strong> number <strong>of</strong> initial communities equals <strong>the</strong>number <strong>of</strong> nodes.2. Each node considers each <strong>of</strong> its neighbors <strong>and</strong> evaluates whe<strong>the</strong>r joining <strong>to</strong> <strong>the</strong>neighbor’s community would increase <strong>the</strong> modularity <strong>of</strong> <strong>the</strong> community structure.After evaluating all <strong>the</strong> neighbors, it will join <strong>the</strong> community <strong>of</strong> <strong>the</strong> neighbor thatachieves <strong>the</strong> maximal modularity increase (only if <strong>the</strong> change is positive; o<strong>the</strong>rwise<strong>the</strong> node will remain in its own community). This will be repeatedly applied for allnodes until no more positive gain is achievable.3. The result <strong>of</strong> Step 2 is converted <strong>to</strong> a new meta-network at a higher level, by aggregatingnodes that belonged <strong>to</strong> a single community in<strong>to</strong> a meta-node, representingedges that existed within each community as <strong>the</strong> weight <strong>of</strong> a self-loop attached <strong>to</strong><strong>the</strong> meta-node, <strong>and</strong> representing edges that existed between communities as <strong>the</strong>weights <strong>of</strong> meta-edges that connect meta-nodes.4. The above two steps are repeated until no more modularity improvement is possible.One nice thing about this method is that it is parameter-free; you don’t have <strong>to</strong> specify<strong>the</strong> number <strong>of</strong> communities or <strong>the</strong> criteria <strong>to</strong> s<strong>to</strong>p <strong>the</strong> algorithm. All you need is <strong>to</strong> providenetwork <strong>to</strong>pology data, <strong>and</strong> <strong>the</strong> algorithm heuristically finds <strong>the</strong> community structure thatis close <strong>to</strong> optimal in achieving <strong>the</strong> highest modularity.Unfortunately, NetworkX doesn’t have this Louvain method as a built-in function, butits Python implementation has been developed <strong>and</strong> released freely by Thomas Aynaud,which is available from http://perso.crans.org/aynaud/communities/. Once you installit, a new community module becomes available in Python. Here is an example:

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

Saved successfully!

Ooh no, something went wrong!