class: center, middle, inverse, title-slide # Modelling small worlds ### David Garcia, Petar Jerčić, Jana Lasser
TU Graz
### Computational Modelling of Social Systems --- layout: true <div class="my-footer"><span>David Garcia - Computational Modelling of Social Systems</span></div> --- ## So far - **Block 1: Fundamentals of agent-based modelling** - Basics of agent-based modelling: the micro-macro gap - Modelling segregation: Schelling's model - Modelling cultures - **Block 2: Opinion dynamics** - Basics of spreading: Granovetter's threshold model - Opinion dynamics - Modelling hyperpolarization and cognitive balance - **Block 3: Fundamentals of agent-based modelling** - Basic network models - **Today: Modelling small worlds** - Scale-free networks - Growth processes --- # Overview ## 1. The small world phenomenon ## 2. The Watts-Strogatz model ## 3. Social small world model --- # The small world phenomenon ## *1. The small world phenomenon* ## 2. The Watts-Strogatz model ## 3. Social small world model --- # It's a small world! <img src="Figures/Friends.png" width="800" style="display: block; margin: auto;" /> --- # Six degrees of separation .pull-left[ <img src="Figures/SixDegrees.jpg" width="330" style="display: block; margin: auto;" /> ] .pull-right[ <img src="Figures/Linked.jpg" width="300" style="display: block; margin: auto;" /> ] --- # The Bacon number <img src="Figures/bacon.png" width="900" style="display: block; margin: auto;" /> --- ## Milgram's small world experiment .pull-left[ - 160 people in Omaha try to reach one person in Boston by mail to their acquaintances - 44 letters reached the target with six steps on average - Short path length as evidence of small-world - However, some letters did not agree, are those paths infinite? ] .pull-right[ <img src="Figures/map_us.png" width="500" style="display: block; margin: auto;" /> ] --- # Refresher: Network distance .pull-left[ The **distance** between nodes `\(v\)` and `\(w\)` is denoted as `\(dist(v,w)\)` and measures the minimum length among all the paths connecting `\(v\)` and `\(w\)`. If there is no path between `\(v\)` and `\(w\)`, the distance between them is defined as `\(dist(v,w) := \infty\)`. Example: `\(dist(b, e) = 2\)` In directed networks, it might happen that `\(dist(v,w) \neq dist(w,v)\)`. ] .pull-right[ <img src="Figures/networkUndirected.png" width="400" style="display: block; margin: auto;" /> ] --- # Average path length .pull-left[ $$ \langle l \rangle = \frac{1}{N(N-1)}\sum_{u,v} dist(u,v) $$ - Global metric for the whole network - It makes sense when network is connected, otherwise `\(\langle l \rangle= \infty\)` - In the example, `\(\langle l \rangle=1.7\)` ] .pull-right[ <img src="Figures/networkUndirected.png" width="400" style="display: block; margin: auto;" /> ] --- # Refresher: Clustering coefficient .pull-left[ **Local clustering coefficient**: `$$C_i = \frac{2*t(i)}{d_i *(d_i−1)}$$` - `\(d_{out}(i)\)` is the degree of `\(i\)` (>1) - `\(t(i)\)` is the number of pairs of neighbors of `\(i\)` that are connected **Average clustering coefficient**: `$$C = \frac{1}{N} \sum_i C_i$$` ] .pull-right[ <img src="Figures/closedTriad.png" width="400" style="display: block; margin: auto;" /> ] --- # The Watts-Strogatz model ## 1. The small world phenomenon ## *2. The Watts-Strogatz model* ## 3. Social small world model *Collective dynamics of ‘small-world’ networks. Duncan J. Watts & Steven H. Strogatz. Nature (1998)* --- # Clustering versus small distances - Triangles reduce distances: all nodes in a triangle are at distance one - Clustering and short path lengths appear to be opposing properties - Social networks have high clustering (lots of triangles), can they also have short paths? Is the six degrees observation a robust one? ** Research question: can a model produce networks with both high clustering and low average path distance?** Additional conditions: - Network is large ( `\(N \gg 1\)` ) - Network is sparse, like a social network ( `\(\langle k \rangle \ll N\)` ) --- # The Watts-Strogatz model .pull-left[ - Start with a fixed ring where `\(N\)` nodes are connected to `\(k\)` neighbors in the ring (example: `\(N=20\)`, `\(k=4\)`) - For each edge: - With probability `\(p\)`: rewire the edge uniformly at random (two versions: only one endpoint or both are rewired) ] .pull-right[ <img src="Figures/WS-1.png" width="300" style="display: block; margin: auto;" /> ] --- # From order to randomness <img src="Figures/WS.png" width="1000" style="display: block; margin: auto;" /> --- # Properties of the lattice ( `\(p=0\)` ) .pull-left[ **Average clustering coefficient:** $$C(0) \sim 3/4 $$ (tunable value of `\(C\)` based on `\(k\)`) ** Average path length:** $$L(0) = \frac{N}{2k} $$ (very high path length, grows linearly with network size) ] .pull-right[ <img src="Figures/WS-1.png" width="300" style="display: block; margin: auto;" /> ] --- # C(p) and L(p) versus C(0) and L(0) <img src="Figures/WS-result.png" width="750" style="display: block; margin: auto;" /> --- # Empirical versus random networks Empirical network analysis of `\(L\)` and `\(C\)` compared to random networks with the same number of nodes and edges (null model, `\(G(n,m)\)` ) | Network | `\(L_{actual}\)` | `\(L_{random}\)` | `\(C_{actual}\)` | `\(C_{random}\)` | | ----------- | ----------- | ----------- | ----------- | ----------- | | Film actors | 3.65 | 2.99 | 0.79 | 0.00027 | | Power grid | 18.7 | 12.4 | 0.080 | 0.005 | | C. elegans | 2.65 | 2.25 | 0.28 | 0.05 | **Evidence of small world networks: empirical networks have average path lenghts close to random networks but much higher average clustering** --- # Social small world model ## 1. The small world phenomenon ## 2. The Watts-Strogatz model ## *3. Social small world model* *Networks, Dynamics, and the Small‐World Phenomenon. Duncan J. Watts. American Journal of Sociology (1999)* --- # Social networks aren't lattices .pull-left[ <img src="Figures/Karate.jpg" width="750" style="display: block; margin: auto;" /> ] .pull-right[ <img src="Figures/Politnetz.png" width="750" style="display: block; margin: auto;" /> ] --- # Extreme case: the caveman graph <img src="Figures/Caveman.png" width="450" style="display: block; margin: auto;" /> --- # Modeling social small worlds - Start with a ring of n nodes - For each pair of nodes (in random order): - Calculate number of shared friends `\(m_{i,j}\)` - Calculate propensity to connect `\(R_{i,j}\)` based on `\(m_{i,j}\)` - Connect them with probability `\(R_{i,j}\)` `\(R_{i,j}\)` has a non-zero but low base probability `\(p\)` of any two nodes connecting regardless of their number of shared friends The dependence of `\(R_{i,j}\)` on `\(m_{i,j}\)` interpolates between a regular (caveman network) and a random network. The reality should be somewhere in between --- # Modeling propensity to triadic closure <img src="Figures/Propensity.png" width="825" style="display: block; margin: auto;" /> --- # Formalizing propensity to triadic closure <img src="Figures/PropensityEquation.png" width="800" style="display: block; margin: auto;" /> - `\(R_{i,j}\)`: propensity to connect of agents `\(i\)` and `\(j\)` - `\(m_{i,j}\)`: mutual friends between `\(i\)` and `\(j\)` - `\(p\)`: base probability to connect when no common friends - `\(k\)`: average degree of network - `\(\alpha\)`: exponent that defines curvature of `\(R_{i,j}\)` versus `\(m_{i,j}\)` - `\(0 \le \alpha \le \infty\)` --- # `\(\alpha\)` in propensity <img src="Figures/Propensity2.png" width="825" style="display: block; margin: auto;" /> --- # Avg path length vs `\(\alpha\)` <img src="Figures/CavemanPathLength.png" width="850" style="display: block; margin: auto;" /> --- # Clustering coefficient vs `\(\alpha\)` <img src="Figures/CavemanClustering.png" width="850" style="display: block; margin: auto;" /> --- # "Small-worldness" vs `\(\alpha\)` <img src="Figures/CavemanResult.png" width="670" style="display: block; margin: auto;" /> **For an intermediate range of values of `\(\alpha\)`, average path length is low while the clustering coefficient is high.** --- ## Summary - The small world phenomenon - Anecdotes and literature suggest that the distance between two random people in the world is not so large - Refresher: average path length and average clustering coefficient - The Watts-Strogatz model - From a regular lattice to a random network rewiring with probability `\(p\)` - For a wide range of middle values of `\(p\)`, clustering is high and average path lengths are low - Empirical networks show this when compared to random networks - Social small world model - Cavemen rather than lattices as regular network - `\(\alpha\)` modulates shape of propensity to connect vs friendships share - Shows small-world behavior for an intermediate range of `\(\alpha\)` --- # Quiz - What fraction of letters in Milgram's experiment reached their destination? - What is the average path length of a network with an isolated node? - What is the average clustering coefficient of a tree? - What is the null model to compare small-world measurements? - What is a better model of a social network, a lattice or a cavemen network? - if `\(\alpha\)` is zero, do you connect to the friends of your friends very often?