Models of networks (synthetic networks or generative models): Random, Small-world, Scale-free, Configuration model and Random geometric model
By: Ralucca Gera, NPS
Excellence Through Knowledge The world around us as a network
• What do social networks look like? Watch this video
• What categories do we have for networks? Random networks (normal degree distribution) Scale free (power-law degree distribution)
2 The three papers for each of the models
•“On Random Graphs I” by Paul Erdos and Alfed Renyi in Publicationes Mathematicae (1958) Times cited: 3, 517 (as of January 1, 2015)
•“Collective dynamics of ‘small-world’ networks” by Duncan Watts and Steve Strogatz in Nature, (1998) Times cited: 24, 535 (as of January 1, 2015)
•“Emergence of scaling in random networks” by László Barabási and Réka Albert in Science, (1999) Times cited: 21, 418 (as of January 1, 2015)
3 Why understand the structure of networks?
• Applications such as epidemiology: Viruses propagate much faster in scale-free networks. Vaccination of random nodes in scale free does not work, but targeted vaccination is very effective • Thus, we can create models that captures the structure which facilitates research: – Create fast networks of particular models can be quickly and cheaply generated, instead of collecting and cleaning the data that takes time – Promote understanding of the world around us: What effect does the degree distribution have on the behavior of the system? Reference network: Regular Lattice
The 1-dimensional lattice is the Harary graph H(n,r) or the Circulant graph (1, 2, …, r) start with an n-cycle, and each vertex is adjacent to r/2 vertices to the left, and r/2 vertices to the right.
Source: http://mathworld.wolfram.com/CirculantGraph.html 5 Reference network: Regular Lattice
a particular Circulant graph (1, 2, …, r):
Source: http://mathworld.wolfram.com/CirculantGraph.htmlSource: http://mathworld.wolfram.com/CirculantGraph.html 6 Reference network: Regular Lattice
• The higher dimensions are generalizations of these. An example is a hexagonal lattice is a 2-dimensional lattice: graphene, a single layer of carbon atoms with a honeycomb lattice structure.
Source: http://phys.org/news/2013-05-intriguing-state-previously-graphene-like-materials.html 7 ERDŐS-RÉNYI RANDOM GRAPHS Random graphs (Erdős-Rényi , 1959)
• RG is a model in which some specific set of parameter takes fixed values, and the network is created at random using these values. • Two main examples: – G(n,p): fix n and probability p of the edges between vertices. The number of edges is not fixed. This is the default construction. – G(n, m): fix n and m – The mean value of edges:
9 G(n,m)
• To make a random network: take n nodes, m unlabeled edges, and put the edges down randomly between the n vertices • Put the graph in a box, make another one and put it in the box, and another one… • Pull one network at random out of the box and it will have a Normal Degree Distribution (classic degree distribution): almost everyone has the same number of friends on average
10 G(n,m)
Method two and equivalent to the first: • To make a random network: – take n nodes, – m pairs at random – place the edges between the randomly chosen nodes • The average degree: , where is often used to denote the degree of vertex i in complex networks (enumerate the vertices, 1, 2, …)
11 G(n,p)
• To make a random network: – take n nodes, – A fixed probability p – Attach edges at random to the nodes, with the probability p
12 Degree distribution is Normal
Both for G(n,p) and G(n,m) 13 Erdős-Rényi random networks
• There might be some that are a bit different that don’t have this degree distribution, but there are so few of them, that you will not pull one out of this box • The universe doesn’t produce these (they are made by us, they are mathematically constructed) rather scale-free • We will construct them using Gephi and NetworkX. For Gephi you will need the plug-in. We will practice with NetworkX since there are more synthetic models and classes available in NetworkX 14 Generating Erdős-Rényi random networks.
• ER graphs are models of a network in which some specific set of parameters take fixed values, but the construction of the network is random (see below in Gephi)
15 Generating Erdős-Rényi
16 Generating Erdős-Rényi random networks
Reference for python: http://networkx.lanl.gov/reference/generated/networkx.generators.random_graphs.erdos_r enyi_graph.html#networkx.generators.random_graphs.erdos_renyi_graph 17 WATTS-STROGATZ SMALL WORLD GRAPHS (1998) Small worlds, between perfect order and chaos
the first graph is completely ordered (probability p =0), the graph in the middle is a "small world" graph (0 < p < 1), the graph at the right is complete random (p=1).
Source: http://www.bordalierinstitute.com/target1.html 19 Small world models
• Duncan Watts and Steven Strogatz small world model: a few random links in an otherwise structured graph make the network a small world: the average shortest path is short
regular lattice: small world: random graph: my friend’s friend is mostly structured all connections always my friend with a few random random connections
Source: Watts, D.J., Strogatz, S.H. (1998) Collective dynamics of 'small-world' networks. Nature 393:440-442. small worlds
Small worlds – a friend of a friend is also frequently a friend (clustering coefficient) – but only small number of hops separate any two people in the world (small average path)
Arnold Schwarzenegger. – thomashawk, Flickr; http://creativecommons.org/licenses/by-nc/2.0/deed.en Generating Watts-Strogatz
22 Generating Watts-Strogatz networks
http://networkx.lanl.gov/reference/generated/networkx.generators.random_graphs .watts_strogatz_graph.html#networkx.generators.random_graphs.watts_strogatz_ graph 23 PREFERENTIAL ATTACHMENT MODEL (WE WILL CONSIDER THE BARABASI-ALBERT EXAMPLE) Scale-free
• Scale-free networks are a type of small world networks. • They have – A power-law degree distribution: – Static or evolutionary • One way to create them is through preferential attachment, but it is not the only way. • We will particularly look at Barabasi-Albert type (one of the most common ones) Power law networks
• Many real world networks contain hubs: highly connected nodes • Usually the distribution of edges is extremely skewed
many nodes with small degree
fat tail: a few nodes with a very large degree number of nodes of that degree that of nodes of number
Degree (number of edges)
no “typical” degree But is it really a power-law?
• A power-law will appear as a straight line on a log-log plot: let be the count of vertices of degree k. ln ln Log of number of nodes of that degree nodes of Log of number
log of the degree • A deviation from a straight line could indicate a different distribution: – exponential – lognormal Network growth & resulting structure
• random attachment: new node picks any existing node to attach to • preferential attachment: new node picks from existing nodes according to their degrees (high preference for high degree)
http://projects.si.umich.edu/netlearn/NetLogo4/RAndPrefAttachment.html Scale Free networks
• One example is the one introduced by Barabasi-Albert based on preferential attachment:
– Start with a small set of nodes ( ) and no edges – Attach new nodes one at the time; • each with the same fixed number of new edges, attaching to the existing ones in the network, with preference for high degrees (once the high degrees appear) https://www.youtube.com/watch?v=5YdkhWB_uYQ This is not the only way to get scale–free networks! 29 Generating Barabasi-Albert
30 Generating Barabasi-Albert
31 Generating Barabasi-Albert networks
http://networkx.lanl.gov/reference/generated/networkx.generators.random_gra phs.barabasi_albert_graph.html#networkx.generators.random_graphs.baraba si_albert_graph 32 Modified BA • Many modifications of this model exists, based on: – Nodes “retiring” and losing their status – Nodes disappearing (such as website going down) – Links appearing or disappearing between the existing nodes (called internal links) – Fitness of nodes (modeling newcomers like Google) • Most researchers still use the standard BA model when studying new phenomena and metrics. Why? It is a simple model, and it was the first model that brought in growth (as well as preferential attachment) 33 The Malloy Reed Configuration model The configuration model
• A random graph model created based on Degree sequence of choice (can be scale free)
• Maybe more than degree sequence is needed to be controlled in order to create realistic models35 The Random Geometric model Random Geometric Model • Again the connections are created at random, but based on proximity rather than preferential attachment (such as ad hoc networks) • Recall that BA was introduced based on the data obtained from the Web, where physical proximity is irrelevant. • But if one would want to model something like the Internet, then proximity is relevant • There is no perfect model for the world around us, not even for specific types of networks • No model has been introduced for the Internet37 An example of a random geometric
https://www.youtube.com/watch?v=NUisb1-INIE 38 A zoo of complex networks Random, Small-World, Scale-Free
Scale Free networks: 1. High degree heterogeneity 2. Various levels of modularity 3. Various levels of randomness
Man made, “large world”:
40 http://noduslabs.com/radar/types-networks-random-small-world-scale-free/ Networks and their degree distributions
We tend to characterize networks by their degree distributions: – Random graphs iff Poisson degree distribution – Scale free iff power-law degree distribution. But they are not! Rather: – If G is a random graphs, then G has Poisson degree distribution – If G is scale free, then G most probably has a power-law degree distribution. – If G was constructed using preferential attachment, then G has a power-law degree distribution. 41 Power-law graph
number of nodes found
94
67 63
54
2 6 1 Poisson distribution
number of nodes found
93
19 15 11 7 3 1 Power-law networks are robust to random breakdown But are especially vulnerable to targeted attack
• Targeting and removing hubs can quickly break up the network In social networks, it’s nice to be a hub
mike But it depends on what you’re sharing… Python
• References to the classes that exist in python: http://networkx.lanl.gov/reference/generators.html
48