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.

15.6. GENERATING RANDOM GRAPHS 323R<strong>and</strong>om graphs can also be generated by r<strong>and</strong>omizing existing graph <strong>to</strong>pologies.Such network r<strong>and</strong>omization is particularly useful when you want <strong>to</strong> compare a certainproperty <strong>of</strong> an observed network with that <strong>of</strong> a r<strong>and</strong>omized “null” model. For example,imagine you found that information spreading was very slow in <strong>the</strong> network you werestudying. Then you could test whe<strong>the</strong>r or not <strong>the</strong> network’s specific <strong>to</strong>pology caused thisslowness by simulating information spreading on both your network <strong>and</strong> on its r<strong>and</strong>omizedcounterparts, <strong>and</strong> <strong>the</strong>n comparing <strong>the</strong> speed <strong>of</strong> information spreading between <strong>the</strong>m.There are several different ways <strong>to</strong> r<strong>and</strong>omize network <strong>to</strong>pologies. They differ regardingwhich network properties are <strong>to</strong> be conserved during r<strong>and</strong>omization. Some examples areshown below (here we assume that g is <strong>the</strong> original network <strong>to</strong> be r<strong>and</strong>omized):• gnm_r<strong>and</strong>om_graph(g.number_<strong>of</strong>_nodes(), g.number_<strong>of</strong>_edges()) conserves <strong>the</strong>numbers <strong>of</strong> nodes <strong>and</strong> edges, nothing else.• r<strong>and</strong>om_degree_sequence_graph(g.degree().values()) conserves <strong>the</strong> sequence<strong>of</strong> node degrees, in addition <strong>to</strong> <strong>the</strong> numbers <strong>of</strong> nodes <strong>and</strong> edges. As noted above,this function may not generate a graph within a given number <strong>of</strong> trials.• expected_degree_graph(g.degree().values()) conserves <strong>the</strong> number <strong>of</strong> nodes<strong>and</strong> <strong>the</strong> sequence <strong>of</strong> “expected” node degrees. This function can always generate agraph very quickly using <strong>the</strong> efficient Miller-Hagberg algorithm [64]. While <strong>the</strong> generatednetwork’s degree sequence doesn’t exactly match that <strong>of</strong> <strong>the</strong> input (especiallyif <strong>the</strong> network is dense), this method is <strong>of</strong>ten a practical, reasonable approach for<strong>the</strong> r<strong>and</strong>omization <strong>of</strong> large real-world networks.• double_edge_swap(g) conserves <strong>the</strong> numbers <strong>of</strong> nodes <strong>and</strong> edges <strong>and</strong> <strong>the</strong> sequence<strong>of</strong> node degrees. Unlike <strong>the</strong> previous three functions, this is not a graphgeneratingfunction, but it directly modifies <strong>the</strong> <strong>to</strong>pology <strong>of</strong> graph g. It conducts whatis called a double edge swap, i.e., r<strong>and</strong>omly selecting two edges a − b <strong>and</strong> c − d,removing those edges, <strong>and</strong> <strong>the</strong>n creating new edges a − c <strong>and</strong> b − d (if ei<strong>the</strong>r pairis already connected, ano<strong>the</strong>r swap will be attempted). This operation realizes aslight r<strong>and</strong>omization <strong>of</strong> <strong>the</strong> <strong>to</strong>pology <strong>of</strong> g, <strong>and</strong> by repeating it many times, you cangradually r<strong>and</strong>omize <strong>the</strong> <strong>to</strong>pology from <strong>the</strong> original g <strong>to</strong> a completely r<strong>and</strong>omizednetwork. double_edge_swap(g, k) conducts k double edge swaps. There is alsoconnected_double_edge_swap available, which guarantees that <strong>the</strong> resulting graphremains connected.

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

Saved successfully!

Ooh no, something went wrong!