0% found this document useful (0 votes)
14 views113 pages

03 CD Phan Tich Mang Xa Hoi - Mo Hinh Toan Cho Mang Xa Hoi

The document discusses mathematical models for social networks, emphasizing the structure and properties of these networks, including degree distributions, clustering coefficients, and small-world phenomena. It covers generative models like the Erdős-Rényi model and the implications of power-law distributions in real-life networks. Additionally, it explores the dynamics of network evolution and the significance of connected components and phase transitions in random graphs.

Uploaded by

hoang hoang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views113 pages

03 CD Phan Tich Mang Xa Hoi - Mo Hinh Toan Cho Mang Xa Hoi

The document discusses mathematical models for social networks, emphasizing the structure and properties of these networks, including degree distributions, clustering coefficients, and small-world phenomena. It covers generative models like the Erdős-Rényi model and the implications of power-law distributions in real-life networks. Additionally, it explores the dynamics of network evolution and the significance of connected components and phase transitions in random graphs.

Uploaded by

hoang hoang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 113

Buổi 03 – Chuyên Đề Phân tích Mạng Xã Hội

Mô hình toán cho mạng


(Mathematical models of networks)

TS. Nguyễn Thành Huy


[email protected]
2

Review
Data Analysis for Social
Networks
What is a social network?
• Social network is a graph G=(V,E)
• V: set of users
• E: connections/friendships among users
• Links denote a social interaction
• Networks of acquaintances
• collaboration networks
• actor networks
• co-authorship networks
• director networks
• phone-call networks
• e-mail networks
• IM networks
• Bluetooth networks
• sexual networks
• home page/blog networks
Themes in Data Analysis for Social Networks
• Measure characteristics of social networks (Measurements)
• How many hops apart are two random Facebook users
• Design models that capture the generation process of network
data (Generative Models)
• Generate graphs with the same properties as real social network graphs
• Algorithmic problems related to (Algorithmic SN analysis)
• Information propagation
• Advertising
• Expertise finding
• Privacy
Measuring Networks
• Degree distributions
• Small world phenomena
• Clustering Coefficient
• Mixing patterns
• Degree correlations
• Communities and clusters
Degree distributions
• Problem: find the probability distribution that best fits the
observed data
fk = fraction of nodes with degree k
frequency
= probability of a randomly
selected node to have degree k

fk

k degree
Power-law distributions
• The degree distributions of most real-life networks follow a power law
p(k) = Ck-α

• Right-skewed/Heavy-tail distribution
• there is a non-negligible fraction of nodes that has very high degree (hubs)
• scale-free: no characteristic scale, average is not informative

• In stark contrast with the random graph model!


• Poisson degree distribution, z=np

zk −z
p(k) = P(k;z) = e
k!
• highly concentrated around the mean
• the probability of very high degree nodes is exponentially small
Power-law signature
• Power-law distribution gives a line in the log-log plot
log p(k) = -αlogk + logC

log frequency α
frequency

degree log degree

• α: power-law exponent (typically 2 ≤ α≤ 3)


Examples

Taken from [Newman 2003]


Average/Expected degree
• For random graphs z = np

• For power-law distributed degree


• if α ≥ 2, it is a constant
• if α < 2, it diverges
Maximum degree
• For random graphs, the maximum degree is highly concentrated around the
average degree z
• For power law graphs

kmax  n 1/(α−1)
Clustering (Transitivity) coefficient
• Measures the density of triangles (local clusters) in the graph
• Two different ways to measure it:
• The ratio of the means

 triangles centered at node i


C(1) = i

 triples centered at node i


i
Example

1 4

(1) 3 3
2
5 C = =
1 +1 + 6 8
Clustering (Transitivity) coefficient
• Clustering coefficient for node i

triangles centered at node i


Ci =
triples centered at node i

• The mean of the ratios

1
C(2)
= Ci
n
Example

1 13
(1+1 +1 6) =
1 4
C
(2)
=
5 30
3
2
5
3
C
(1)
=
8

• The two clustering coefficients give different


measures
• C(2) increases with nodes with low degree
Clustering coefficient for random graphs
• The probability of two of your neighbors also being neighbors
is p, independent of local structure
• clustering coefficient C = p
• when z is fixed C = z/n =O(1/n)
The C(k) distribution
• The C(k) distribution is supposed to capture the hierarchical
nature of the network
• when constant: no hierarchy
• when power-law: hierarchy

C(k) = average clustering coefficient


of nodes with degree k

C(k)

k degree
The small-world experiment
• Milgram 1967
• Picked 300 people at random from Nebraska
• Asked them to get the letter to a stockbroker in Boston – they could bypass
the letter through friends they knew on a first-name basis
• How many steps does it take?
• Six degrees of separation: (play of John Guare)
Six Degrees of Kevin Bacon
• Bacon number:
• Create a network of Hollywood actors
• Connect two actors if they co-appeared in some movie
• Bacon number: number of steps to Kevin Bacon
• As of Dec 2007, the highest (finite) Bacon number reported is 8
• Only approx 12% of all actors cannot be linked to Bacon
• What is the Bacon number of Elvis Prisley?
The small-world experiment
• 64 chains completed
• 6.2 average chain length (thus “six degrees of separation”)
• Further observations
• People that owned the stock had shortest paths to the stockbroker than random
people
• People from Boston area have even closer paths
Measuring the small world phenomenon
• dij = shortest path between i and j
• Diameter: d = max d ij
i, j

• Characteristic path length:


1
ℓ= 
n(n -1)/2 i j
dij
• Harmonic mean
1
ℓ =
−1

n(n -1)/2 i j
-1
d ij

• Also, distribution of all shortest paths


Is the path length enough?
• Random graphs have diameter
logn
d=
logz

• d=logn/loglogn when z=ω(logn)

• Short paths should be combined with other


properties
• ease of navigation
• high clustering coefficient
Degree correlations
• Do high degree nodes tend to link to high degree nodes?
• Pastor Satoras et al.
• plot the mean degree of the neighbors as a function of the degree

<Knn(K)>
Degree correlations
• Newman
• compute the correlation coefficient of the degrees of the two endpoints of an edge
• assortative/disassortative

r > 0: assortative
r < 0: disassortative
r = 0: Không có mỗi liên kết rõ ràng
Connected components
• For undirected graphs, the size and distribution of the connected
components
• is there a giant component?
• For directed graphs, the size and distribution of strongly and weakly
connected components
Graph eigenvalues
• For random graphs • For the Internet (Faloutsos3)
• semi-circle law

The eigenvalues of a graph are defined as the eigenvalues of its adjacency matrix. The set of
eigenvalues of a graph is called a graph spectrum.

The largest eigenvalue absolute value in a graph is called the spectral radius of the graph, and the
second smallest eigenvalue of the Laplacian matrix of a graph is called its algebraic connectivity. The
sum of absolute values of graph eigenvalues is called the graph energy.
30

Graph eigenvalues
Connected components
• For undirected graphs, the size and distribution of the connected
components
• is there a giant component?
• For directed graphs, the size and distribution of strongly and weakly
connected components
32

Generative Network
Model
33

Network models
• Empirical network features:
• Power-law (heavy-tailed) degree distribution
• Small average distance (graph diameter)
• Large clustering coefficient (transitivity)

• Generative models:
• Random graph model (Erdos & Renyi, 1959)
• ”Small world” model (Watts & Strogatz, 1998)
• Preferential attachement model (Barabasi & Albert, 1999)
Generative Network Model
• How to generate graphs that have the desired properties
• Degree distribution
• Clustering coefficient
• Average path length

• We are going to talk about generative models


What is a network model?
• Informally, a network model is a process (radomized
or deterministic) for generating a graph
• Models of static graphs
• input: a set of parameters Π, and the size of the graph n
• output: a graph G(Π,n)
• Models of evolving graphs
• input: a set of parameters Π, and an initial graph G0
• output: a graph Gt for each time t
36

Random Graph Model


37

Tài liệu tham khảo


• On random graphs I, P. Erdos and A. Renyi, Publicationes Mathematicae 6,
290–297 (1959).
• On the evolution of random graphs, P. Erdos and A. Renyi, Publicaton of the
Mathematical Institute of the Hungarian Academy of Sciences, 17-61 (1960)
Families of random graphs
• A deterministic model D defines a single graph for
each value of n (or t)

• A randomized model R defines a probability space


‹Gn,P› where Gn is the set of all graphs of size n, and P
a probability distribution over the set Gn (similarly for
t)
• we call this a family of random graphs R, or a random graph
R
Erdös-Renyi Random graphs

Paul Erdös (1913-1996)


Erdös-Renyi Random Graphs
• The Gn,p model
• input: the number of vertices n, and a parameter p, 0 ≤ p ≤ 1
• process: for each pair (i,j), generate the edge (i,j) independently with probability p

• Related, but not identical: The Gn,m model


• process: select m edges uniformly at random
Graph properties
• A property P holds almost surely (or for almost every graph), if

lim PG has P= 1


n→

• Evolution of the graph: which properties hold as the


probability p increases?

• Threshold phenomena: Many properties appear suddenly.


That is, there exist a probability pc such that for p<pc the
property does not hold a.s. and for p>pc the property holds
a.s.

• What do you expect to be a threshold phenomenon in


random graphs?
42

Random graph model


• Graph G{E, V}, nodes n = |V|, edges m = |E|
• Random graph models (Erdos and Renyi, 1959)
• 𝐺𝑛,𝑚 a randomly selected graph from the set of 𝐶𝑛𝑚 graphs, 𝑁 = 𝑛 𝑛−1
, with n nodes
2
and m edges
• 𝐺𝑛,𝑝 G(n, p) each pair out of 𝑁 = 𝑛 𝑛−1
pairs of nodes is connected with probability
2
p, m - random number

Erdős, Paul, and Alfréd Rényi. "On the evolution of random graphs." Publ. math. inst. hung. acad. sci 5, no. 1 (1960): 17-60.
43

Random graph model G(n, p)


In G(n, p) model, probability for a network to have m links is given by binomial
distribution:
𝑃 𝑚 = 𝐶𝑁𝑚 𝑝 𝑚 1 − 𝑝 𝑁−𝑚
where
• 𝑁=𝑛 𝑛−1
2
• 𝑝 𝑚 - probability that m links are present
• 1 − 𝑝 𝑁−𝑚 - probability that other links are not
𝑁!
• 𝐶𝑁𝑚 = - number of ways to select m links out of all N
𝑚! 𝑁−𝑚 !
• Expected number of links:
44

Example: Random graph model G(n, p)

top: n = 12, p = 1/6 bottom: n = 100, p = 0.03


45

Degree distribution
Probability that i-th node has a degree ki = k is given by binomial distribution:

where:
• 𝑝𝑘 probability that connects to k nodes (has k-edges)
• 1 − 𝑝 𝑛−1−𝑘 probability that does not connect to any other node
𝑘 𝑛−1 !
• 𝐶𝑛−1 = number of ways to select k nodes out of all to connect to
𝑘! 𝑛−𝑘−1 !

Binomial distribution, when ⟨k⟩ << N or n → ∞ and p → 0 at fixed ⟨k⟩, is well


approximated by Poisson distribution:
46

Poisson Distribution
47

Random Graph
48

Random graph model


Consider 𝐺𝑛,𝑝 as a function of p
• p = 0, empty graph - ⟨k⟩ = 0
• p = 1, complete (full) graph - ⟨k⟩ = n − 1
𝑛𝐺
• 𝑛𝐺 largest connected component, 𝑠 =
𝑛

p
49

Random graph model

Structural changes happens when increasing p

igraph:erdos.renyi.game()
= ෍

𝑘=0
𝑃 𝑘 𝑢𝑘 =
𝑘=0
Phase transition
• Let u – fraction of nodes that do not belong to GCC. The probability that a
node does not belong to GCC

𝑢=
𝑛 − 𝑛𝐺
𝑛
= 𝑃 𝑘 = 0 + 𝑃 𝑘 = 1 𝑢 + 𝑃 𝑘 = 2 𝑢2 + 𝑃 𝑘 = 3 𝑢3 + ⋯
𝜆𝑘𝑒−𝜆
𝑘!
𝑢 𝑘 = 𝑒 −𝜆 𝑒 𝜆𝑢 = 𝑒 𝜆

• Let s -fraction of nodes belonging to GCC (size of GCC)


𝑢−1
50
51

Phase transition

non-zero solution exists when (at s = 0):

critical value:
52

Numerical simulations

⟨k⟩ = pn
53

Evolution of random network

Critical value: 𝑘 = 𝑝𝑐𝑛 = 1 - on average one neighbor for a node


from A-L. Barabasi, 2016
54

Phase transition
1
Given Graph 𝐺𝑛,𝑝 for 𝑛 → ∞, there are exist critical value 𝑝𝑐 =
𝑛
• Subcritical regime, 𝑝 < 𝑝𝑐, 𝑘 < 1, there is no components with more than
𝑂 ln 𝑛 nodes, largest component is a tree
• Critical point, 𝑝 = 𝑝𝑐, 𝑘 = 1, the largest component has 𝑂 𝑛2/3 nodes
• Supercritical regime, 𝑝 > 𝑝𝑐, 𝑘 > 1, gigantic component has all 𝑂൫ሺ𝑝−
𝑝𝑐ሻ𝑛൯nodes
• Connected regime, 𝑝 ≫ ln 𝑛 , 𝑘 > ln 𝑛, gigantic component has all 𝑂 𝑛
𝑛
nodes

Critical value: 𝑘 = 𝑝𝑐𝑛 = 1 - on average one neighbor for a node


55

Numerical simulation

Clauset, 2014
56

Threshold probabilities
Given Graph 𝐺𝑛,𝑝, threshold probabilities when different subgraphs of k-nodes
and l-edges appear in a random graph 𝑝𝑠~𝑛−𝑘/𝑙

When p > 𝑝𝑠 :
• 𝑝𝑠~𝑛−𝑘/ 𝑘−1 , having a tree with k nodes
• 𝑝𝑠~𝑛−1, having a cycle with k nodes
• 𝑝𝑠~𝑛−2/ 𝑘−1 , complete subgraph with k nodes

Barabasi, 2002
57

Clustering coefficient
Clustering coefficient (probability that two neighbors link to each other):

when 𝑛 → ∞, C → ∞
58

Graph diameter
𝐺𝑛,𝑝 is locally tree-like (GCC) (no loops; low clustering coefficient)

on average, the number of nodes d steps away from a node:

in GCC, around 𝑝𝑐, 𝑘 𝑑 ∼𝑛


59

Graph diameter
60

Summary of Random graph model


• Node degree distribution function - Binomial/Poisson:

• Average path length:

• Clustering coefficient:
61

Real networks
• Degree distribution in real networks
62

Configuration model
63

Configuration model
• Can be used as a ”null model” for comparative network analysis

Clauset, 2014
Random graphs and real life
• A beautiful and elegant theory studied exhaustively

• Random graphs had been used as idealized network models

• Unfortunately, they don’t capture reality…


A random graph example
Departing from the Random Graph model
• We need models that better capture the characteristics of real graphs
• degree sequences
• clustering coefficient
• short paths
Graphs with given degree sequences
• input: the degree sequence [d1,d2,…,dn]

• Can you generate a graph with nodes that have degrees [d1,d2,…,dn] ?

• ?☺
Graphs with given degree sequences
• The configuration model
• input: the degree sequence [d1,d2,…,dn]
• process:
• Create di copies of node i
• Take a random matching (pairing) of the copies
• self-loops and multiple edges are allowed

• Uniform distribution over the graphs with the given degree sequence
Example
• Suppose that the degree sequence is
4 1 3 2

• Create multiple copies of the nodes

• Pair the nodes uniformly at random


• Generate the resulting network
Graphs with given degree sequences
• How about simple graphs ?
• No self loops
• No multiple edges
Graphs with given degree sequences
• Realizability of degree sequences
• Lemma: A degree sequence d = [d(1),…,d(n)] with d(1)≥d(2)≥… ≥d(n) and
d(1)+d(2)+…+d(n) even is realizable if and only if for every 1≤k ≤n-1 it holds
that
k n

 d (i)  k (k −1) + mink, d (i)


i=1 i=k +1
Graphs with given degree sequences -- algorithm
• Input : d= [d(1),…,d(n)]
• Output: No or simple graph G=(V,E) with degree sequence d

• If Σ i=1…n d(i) is odd return “No”


• While 1 do
• If there exist i with d(i) < 0 return “No”
• If d(i)=0 for all i return the graph G=(V,E)
• Pick random node v with d(v)>0
• S(v) = set of nodes with the d(v) highest d values
• d(v) = 0
• For each node w in S(v)
• E = E\union (v,w)
• d(w) = d(w)-1
How can we generate data with power-law degree
distributions?
74

Preferential
Attachment Model
75

Tài liệu tham khảo


• Emergence of Scaling in Random Networks, A.L. Barabasi and R. Albert,
Science 286, 509-512, 1999
76

Motivation
• Citation networks
• Collaboration networks
• Web Social networks

Most of the networks we study are dynamic, they evolve over time,
expanding by adding new nodes and edges.
Preferential Attachment in Networks
• First considered by [Price 65] as a model for citation
networks
• each new paper is generated with m citations (mean)
• new papers cite previous papers with probability
proportional to their indegree (citations)
• what about papers without any citations?
• each paper is considered to have a “default” citation
• probability of citing a paper with degree k, proportional to k+1

• Power law with exponent α= 2+1/m


Barabasi-Albert model
• The BA model (undirected graph)
• input: some initial subgraph G0, and m the number of edges
per new node
• the process:
• nodes arrive one at the time
• each node connects to m other nodes selecting them with
probability proportional to their degree
• if [d1,…,dt] is the degree sequence at time t, the node t+1 links to
node i with probability
di di
=
idi 2mt
• Results in power-law with exponent α= 3
79

Preferential attachment model


Dynamic growth: start at t = 0 with n0 nodes and m0 ≥ n0 edges
1. Growth
At each time step add a new node with m edges (m ≤ n0), connecting to m
nodes already in netwrok ki(i) = m
2. Preferential attachment
The probability of linking to existing node i is proportional to the node degree
ki

after t timesteps: t + n0 nodes, mt + m0 edges

Barabási, Albert-László, and Réka Albert. "Emergence of scaling in random networks." science 286.5439 (1999): 509-512.
80

Preferential attachment mode

Barabási, Albert-László, and Réka Albert. "Emergence of scaling in random networks." science 286.5439 (1999): 509-512.
81

Preferential attachment
• Continues approximation: continues time, real variable node degree ⟨ki(t)⟩-
expected value over multiple realizations
• Time-dependent degree of a single node:

• Node i is added at time ti : ki(ti) = m

• Solution:
82

Preferential attachement
83

Preferential attachement
84

Preferential attachment
85

Preferential attachement
86

Preferential attachment vs random graph


87

Preferential attachment vs random graph


88

Preferential attachment vs random graph


89

Preferential attachment model


Variations of the BA model
• Many variations have been considered
91

Growing random graph


92

Preferential attachment
93

Non-linear preferential attachment


94

Link selection model


95

Copying model
Copying model
• Input:
• the out-degree d (constant) of each node
• a parameter α
• The process:
• Nodes arrive one at the time
• A new node selects uniformly one of the existing nodes as a
prototype
• The new node creates d outgoing links. For the ith link
• with probability αit copies the i-th link of the prototype node
• with probability 1- αit selects the target of the link uniformly at
random
An example
Copying model properties
• Power law degree distribution with exponent β= (2-α)/(1- α)
• Number of bipartite cliques of size i x d is ne-i

• The model has also found applications in biological networks


• copying mechanism in gene mutations
99

Historical note
• Polya urn model, George Polya, 1923
• Yule process, Udny Yule, 1925
• Distribution of wealth, Herbert Simon,1955
• Evolution of citation networks, cumulative advantage, Derek de
Solla Price, 1976
• Preferential attachment network model, Barabasi and Albert,
1999

Local random models vs global optimization models


100

Small-world Model
101

Tài liệu tham khảo


• Collective dynamics of small-world networks. Duncan J. Watts and Steven
H. Strogatz. Nature 393 (6684): 440-442, 1998
Small world Phenomena
• So far we focused on obtaining graphs with power-law distributions on the
degrees. What about other properties?
• Clustering coefficient: real-life networks tend to have high clustering coefficient
• Short paths: real-life networks are “small worlds”
• this property is easy to generate
• Can we combine these two properties?
103

Motivation
• keep high clustering, get small diameter

Clustering coefficient C = 1/2


Graph diameter d = 8
Small-world Graphs
• According to Watts [W99]
• Large networks (n >> 1)
• Sparse connectivity (avg degree z << n)
• No central node (kmax << n)
• Large clustering coefficient (larger than in random graphs of same size)
• Short average paths (~log n, close to those of random graphs of the same size)
105

Small world
Single parameter model, interpolation between regular lattice and
random graph
• Start with regular lattice with n nodes, k edges per vertex (node
degree), k << n
• Randomly connect with other nodes with probability p, forms
pnk/2 ”long distance” connections from total of nk/2 edges
• p = 0 regular lattice, p = 1 random graph
106

Small world

Watts, Duncan J., and Steven H. Strogatz. "Collective dynamics of ‘small-world’networks." nature 393.6684 (1998): 440-442.
107

Small world model


108

Small world model

20% rewiring:
ave. path length = 3.58 → ave. path length = 2.32
clust. coeff = 0.49 → clust. coeff = 0.19
Mixing order with randomness
• Inspired by the work of Solmonoff and Rapoport
• nodes that share neighbors should have higher probability to be connected
• Generate an edge between i and j with probability proportional to Rij

 1 if mij  z mij = number of common


 m α neighbors of i and j
 ij 
R ij =   (1−p ) + p if 0  mij  z
 z  p = very small probability
 p if mij = 0

• When α= 0, edges are determined by common neighbors


• When α= ∞ edges are independent of common neighbors
• For intermediate values we obtain a combination of order and randomness
Algorithm
• Start with a ring
• For i = 1 … n
• Select a vertex j with probability proportional to Rij and generate an edge (i,j)
• Repeat until z edges are added to each vertex
Clustering coefficient – Avg path length

small world graphs


Watts and Strogatz model [WS98]
• Start with a ring, where every node is connected to the next z
nodes
• With probability p, rewire every edge (or, add a shortcut) to a
uniformly chosen destination.
• Granovetter, “The strength of weak ties”

order randomness

p=0 0<p<1 p=1


Watts and Strogatz model [WS98]
• Start with a ring, where every node is connected to the next z
nodes
• With probability p, rewire every edge (or, add a shortcut) to a
uniformly chosen destination.
• Granovetter, “The strength of weak ties”

order randomness

p=0 0<p<1 p=1


Clustering Coefficient – Characteristic Path
Length

log-scale in p

When p = 0, C = 3(k-2)/4(k-1) ~ ¾ For small p, C ~ ¾


L = n/k L ~ logn
115

Model comparison
116

CÁM ƠN ĐÃ LẮNG
NGHE!

You might also like