Top Banner
Dynamics of Infectious Diseases Networks, percolation, random graphs & generating functions March 12, 2010 Monday, March 15, 2010
40

Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Aug 19, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Dynamics of Infectious Diseases

Networks, percolation, random graphs & generating functions

March 12, 2010

Monday, March 15, 2010

Page 2: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Networks

• also known as graphs, which are mathematical objects consisting of vertices (or nodes) V connected by edges E

• graphs come in many flavors- undirected, directed, weighted undirected/directed, semidirected,

bipartite, multigraphs, hypergraphs, etc.

- special cases: trees, directed acyclic graphs, complete graphs, etc.

Monday, March 15, 2010

Page 3: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Some general reviews of complex networks

http://www.cs.cornell.edu/home/kleinber/networks-book/

Monday, March 15, 2010

Page 4: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Undirected graphs

• set of vertices V connected by edges E with no defined directionality or ordering

• edges consist of (unordered) pairs of nodes

- G(V,E)

Monday, March 15, 2010

Page 5: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Directed graphs

• set of vertices V connected by edges E that possess defined directionality

- G(V,E): edges E involve ordered pairs of vertices (e.g., (source, destination))

Monday, March 15, 2010

Page 6: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Semidirected (or mixed) graphs

• vertices V connected by a mixture of undirected and directed edges Eu and Ed

- G(V,Eu,Ed)

Monday, March 15, 2010

Page 7: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Bipartite graphs

• vertices V belong to two disjoint sets A and B, with every edge connecting a member of A to a member of B

S I R

infection recovery

e.g., movies and actors,

scientific collaborations

Monday, March 15, 2010

Page 8: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Weighted and labeled graphs

• nodes and/or edges contain numerical weights and/or discrete labels

[M]

Mkb

[D]

D2

2

1

1ku

Monday, March 15, 2010

Page 9: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

A few graph properties of interest

• degree

• clustering

• diameter

• mixing patterns

• community structure

• betweenness

• connected components & percolation

Monday, March 15, 2010

Page 10: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Degrees & degree distributions

• vertex degree k = number of edges containing a given vertex in an undirected graph

• vertex degrees (kin, kout) = number of incoming/outgoing edges in a directed graph

• degree distribution = frequency distribution of vertex degrees over a graph

- p(k) for undirected graph

- pin(k), pout(k) for directed graph

- pu(k), pin(k), pout(k) for semidirected graph

Monday, March 15, 2010

Page 11: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Some graphs & degree distributions of interest

• complete graph- all nodes connected to all others

- ki = N for all nodes i

- p(ki=N)=1, p(ki≠N)=0

Monday, March 15, 2010

Page 12: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Some graphs & degree distributions of interest

• Erdős-Rényi random graph (G(n,p) model)- each possible edge between pairs of

distinct nodes [N(N-1)/2 total] present with probability p

- edges independent: binomially distributed with probability p

- expectation value of number of nodes with degree k

- degree distribution approaches Poisson dist. with rate λk for large N

P (ki = k) =�

N − 1k

�pk(1− p)N−1−k

E(Xk) = NP (ki = k) = N

�N − 1

2

�pk(1− p)N−1−k ≡ λk

P (Xk = r) ≈ e−λkλr

k

r!Monday, March 15, 2010

Page 13: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Scale-free networks

• many real-world networks reveal “heavy-tailed” degree distributions- well-described by power law over some range of k

from Barabási & Albert from Newman

Monday, March 15, 2010

Page 14: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Scale-free networks

• “scale-free” refers to the lack of any characteristic scale in a power law (e.g., no characteristic degree k)

• more realistic is a power-law degree distribution with an exponential cutoff at large k- exponential cutoff observed in many systems

- power-law distribution not normalizable for τ < 2

f(x) = axk =⇒ f(cx) = a(cx)k = ckaxk = ckf(x) ∝ f(x)

P (k) = Ck−τe−k/κ for k ≥ 1

Monday, March 15, 2010

Page 15: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Scale-free networks

• a variety of network growth mechanisms can give rise to power-law degree distributions

- most widely known is “preferential attachment”: probability of attaching to a node is proportional to its degree (i.e., the rich get richer)

probability of attachment to node with degree ki

Monday, March 15, 2010

Page 16: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Clustering

• clustering refers to correlations among connections

• specifically, the probability that two neighbors of a vertex are themselves neighbors

?

Monday, March 15, 2010

Page 17: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Network diameter

• diameter = average shortest path length between two nodes

• observations of short average path lengths in real networks (“six degrees of separation”, or “small worlds”)

• widely studied “small world network” model of Watts & Strogatz

Monday, March 15, 2010

Page 18: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Mixing patterns

• mixing: tendency for nodes to be linked to other nodes with similar (assortative) or dissimilar (disassortative) characteristics- e.g., mixing by degree

remaining degree

Monday, March 15, 2010

Page 19: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Community structure

Modularity Q

optimize Q by assigning nodes to clusters

(si, sj = ±1 depending on which of two clusters assigned to)

subdivide further to assign to more clusters (hierarchical clustering)

not just minimize edge crossings (min-cut)

instead, minimize expected number of edge crossings, based on degrees

Monday, March 15, 2010

Page 20: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Betweenness

• betweenness centrality- for each node or edge, the fraction of

shortest paths between pairs of nodes that pass through that node or edge

Monday, March 15, 2010

Page 21: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Connected components

• in an undirected graph- connected component: the set of nodes reachable from one another by

following undirected edges

0

Depth-first

1

2

3

4

5 6

7

0

Breadth-first

1

4

5

2

6 7

3

Monday, March 15, 2010

Page 22: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Connected components

• in a directed graph- weakly connected component: the set of nodes reachable from one

another by following edges independently of defined direction (i.e., as if they were undirected)

- strongly connected component (SCC): the set of nodes reachable from one another by following directed edges

in component

out component

Monday, March 15, 2010

Page 23: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Percolation

• connectivity in random networks; how does a system come together (or fall apart) as more connections are randomly added

bond percolation on a 2D square lattice

site percolation on a 2D triangular lattice

Monday, March 15, 2010

Page 24: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Percolation

from Sethna:Entropy, Order Parameters,

and Complexity

P (p) ∼ (p− pc)β

Size (fractional) of the largest cluster P(p)

example of a continuous phase transition

β = 5/36 for bond percolation on a 2D square lattice, and for site percolation on a 2D triangular lattice (universality, i.e., details

don’t matter in this case)

Monday, March 15, 2010

Page 25: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Percolation

• Erdős-Rényi random graph

P (p) ∼ (p− pc)

i.e., β = 1

Monday, March 15, 2010

Page 26: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

grown graph

static graph

giant component

size is infinitely differentiable for randomly

grown network

Monday, March 15, 2010

Page 27: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

NetworkX

• networkx.lanl.gov- a Python-based package for network

construction & analysis

Monday, March 15, 2010

Page 28: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Networks in disease dynamics

• undirected graphs- e.g., direct contact

- is an undirected graph realistic?

Monday, March 15, 2010

Page 29: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Networks in disease dynamics

• directed graphs- e.g., transportation

Monday, March 15, 2010

Page 30: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Networks in disease dynamics

• directed graphs become undirected- e.g., movement ban

Monday, March 15, 2010

Page 31: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Networks in disease dynamics

• semidirected graphs- e.g., context dependence

from Meyers (2007)

Monday, March 15, 2010

Page 32: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Networks in disease dynamics

• bipartite graphs- e.g., interacting subpopulations (sex?, e.g., males and females)

- e.g., people and locations (schools, workplaces, etc.)

Monday, March 15, 2010

Page 33: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Random graphs

• “random graph” interpreted by many to refer to Erdős-Rényi random graph

• can be generalized to refer to a random graph consistent with some prescribed statistical characterization, e.g., degree distribution

• random graph of N nodes with prescribed degree distribution

- generate “degree sequence” for N nodes randomly drawn from distribution [ki for nodes i=1,...,N]

- generate a list L containing ki copies of each node ID i

- choose random pairs of elements from L (rejecting matches) to form edges of graph G

generate ki “stubs” for each node i,and randomly connect them

Monday, March 15, 2010

Page 34: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Generating functions for disease spread

Monday, March 15, 2010

Page 36: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Generating functions for random graphs

G0(x) =∞�

k=0

pkxk

G0(1) = 1

pk =1k!

dkG0

dxk

����x=0

generating function for degree distribution pk

normalization

derivatives

G0(x) generates the probability distribution pk (through differentiation)

Monday, March 15, 2010

Page 37: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Generating functions for random graphs

moments: averagedegree z

higher moments

z =< k >=�

k

kpk = G�0(1)

< kn >=�

k

knpk =��

xd

dx

�n

G0(x)�

x=1

Monday, March 15, 2010

Page 38: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Generating functions for random graphs

distribution of the degree of the vertices arrived at by choosing a random edge

(not the same as vertex degree distribution since not all vertices have the

same number of edges)

�k kpkxk

�k kpk

= xG�

0(x)G�

0(1)

arrives with probability proportional to degree

G1(x) =G�

0(x)G�

0(1)=

1zG�

0(x)distribution of the excess

degree of the vertices arrived at by choosing a

random edge(i.e., not including the edge we arrived on)

Monday, March 15, 2010

Page 39: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Examples

Poisson-distributed graph

G0(x) =N�

k=0

�N

k

�pk(1− p)N − kxk = (1− p + px)N

= ez(x−1) for large N

G0(x) = G1(x) ⇒ distribution of outgoing edges is the same regardless of whether vertex was chosen at random, or reached from a randomly chosen edge (only for Poisson)

Monday, March 15, 2010

Page 40: Networks, percolation, random graphs & generating ...pages.physics.cornell.edu/.../lectures/...DID_Lec4.pdf · Generating functions • from Wikipedia: “a generating function is

Examples

Exponentially distributed graphpk = (1− e−1/κ)e−k/κ

G0(x) = (1− e−1/κ)�

k=0

e−k/κxk =1− e−1/κ

1− xe−1/κ

G1(x) =�

1− e−1/κ

1− xe−1/κ

�2

Monday, March 15, 2010