19. ◼ Biological networks
Cortical networks
◼ Nodes: cortical areas
◼ Links: functional connectivity between them (EEG, FRMI, …)
19
Complex Networks
20. ◼ Ecological networks
Little Rock Lake (Wisconsin) food web
◼ Nodes: 182 taxa
◼ Links: 2494 relationships of who predates on whom
20
Complex Networks
21. ◼ Social networks
15M social movement
◼ Nodes: 87,569 users
◼ Links: 581,749 Twitter messages
21
Complex Networks
22. ◼ Social networks
Dolphin's network
◼ Nodes: 62 dolphins
◼ Links: 159 non-random
social interactions
22
Complex Networks
23. ◼ Economy
World trade network
◼ Nodes: countries
◼ Links: amount of trade between them
23
Complex Networks
25. 25
◼ Real networks have common characteristics
Sparse
Complex structure
Complex dynamics on networks
Complex dynamics of networks
Complex Networks
Characterizing real complex networks
26. 26
Sparse
◼ N: number of Nodes
◼ M: number of Edges
◼ M ∼ O(N) instead of O(N2)
Complex Networks
27. 27
Sparse
◼ N: number of Nodes
◼ M: number of Edges
◼ M ∼ O(N) instead of O(N2)
Examples
◼ Dolphin's network
Nodes: 62 dolphins
Links: 159 social interactions ≪ 1,891 possible interactions
Average degree: 5.13 edges / node
◼ World air transportation network
Nodes: 3,618 airports
Links: 27,028 connections ≪ 6,543,153 possible connections
Average degree: 14.94 edges / node
Complex Networks
28. 28
Complex structure
◼ Power law degree distribution
◼ Small-world property
◼ Community structure
◼ High transitivity
◼ Assortativity
◼ Rich club
◼ Motifs
Complex Networks
29. 29
Complex dynamics on networks
◼ Diffusion
◼ Epidemic spreading
◼ Rumor and opinion spreading
◼ Synchronization
◼ Random walks
◼ Routing
◼ Evolutionary games
Complex Networks
37. 37
Computational
◼ Complex networks are sparse Avoid adjacency matrices!
Adjacency matrix has 𝑁2
elements to store
Sparse complex networks 𝑂(𝑁) non-zero elements
Representation
38. 38
Computational
◼ Complex networks are sparse Avoid adjacency matrices!
Adjacency matrix has 𝑁2
elements to store
Sparse complex networks 𝑂(𝑁) non-zero elements
◼ Use
Adjacency lists
Lists of edges
Sparse matrix structures (equivalent to adjacency lists)
Representation
41. 41
Computational
◼ Implementation of algorithms
Ensure you use the right type: graph, digraph, multigraph, etc.
Use library functions to iterate over neighbors
Avoid search of edges (implicit or explicit)
Allocate memory for all variables before any loop
Avoid converting iterators to arrays (collect, etc.)
If algorithm is time consuming, use compiled languages (Julia, C++,
Java, etc.)
In python, always use numpy arrays, not lists
Representation
42. 42
Outline
◼ Complex networks?
◼ Representation of complex networks
◼ Structure of complex networks
◼ Models of complex networks
Structure of complex networks
43. 43
◼ Type of network
By type of edge
By type of node
By attributes
◼ Level of description
Microscale
Macroscale
Mesoscale
Structure
Structure of complex networks
44. 44
Type of network
◼ By type of edge
Undirected, Directed
Multilayer: edges of different types
Hypergraph: hyperedges (higher order relations)
Simplicial complex: downward-closed hypergraph
◼ By type of node (and distribution of edges)
Unipartite, Bipartite, Tripartite, etc.
Network of networks
◼ By attributes
Edges with real values: Weighted, unweighted, signed
Annotated graphs: attributes in nodes, attributes in edges
Structure
45. 45
Level of description
◼ Microscale: at the level of nodes
◼ Mesoscale: at the level of groups of nodes
◼ Macroscale: at the level of the whole network
Structure
Macroscale Mesoscale Microscale
48. 48
Microscale
◼ Clustering coefficient
Measures the transitivity of the connections: fraction of
neighbors that are connected between them
𝐶𝑖 =
σ𝑗<𝑘 𝑎𝑖𝑗 𝑎𝑖𝑘 𝑎𝑗𝑘
σ𝑗<𝑘 𝑎𝑖𝑗 𝑎𝑖𝑘
=
2
𝑘𝑖 𝑘𝑖 − 1
𝑗<𝑘
𝑎𝑖𝑗 𝑎𝑖𝑘 𝑎𝑗𝑘 =
=
𝐴3
𝑖𝑖
𝐴𝐹𝐴 𝑖𝑖
, 𝐹𝑖𝑗 = 1 − 𝛿𝑖𝑗
Structure
49. 49
Microscale
◼ Clustering coefficient
Measures the transitivity of the connections: fraction of
neighbors that are connected between them
𝐶𝑖 =
σ𝑗<𝑘 𝑎𝑖𝑗 𝑎𝑖𝑘 𝑎𝑗𝑘
σ𝑗<𝑘 𝑎𝑖𝑗 𝑎𝑖𝑘
=
2
𝑘𝑖 𝑘𝑖 − 1
𝑗<𝑘
𝑎𝑖𝑗 𝑎𝑖𝑘 𝑎𝑗𝑘 =
=
𝐴3
𝑖𝑖
𝐴𝐹𝐴 𝑖𝑖
, 𝐹𝑖𝑗 = 1 − 𝛿𝑖𝑗
Node 1
neighbors: 4
connected neighbors: 2
non-connected neighbors: 4
pairs of neighbors: 6
𝐶𝑖 = 2/6 = 0.33
Structure
1 2
3 4
5
50. 50
Microscale
◼ Clustering coefficient
Measures the transitivity of the connections: fraction of
neighbors that are connected between them
𝐶𝑖 =
σ𝑗<𝑘 𝑎𝑖𝑗 𝑎𝑖𝑘 𝑎𝑗𝑘
σ𝑗<𝑘 𝑎𝑖𝑗 𝑎𝑖𝑘
=
2
𝑘𝑖 𝑘𝑖 − 1
𝑗<𝑘
𝑎𝑖𝑗 𝑎𝑖𝑘 𝑎𝑗𝑘 =
=
𝐴3
𝑖𝑖
𝐴𝐹𝐴 𝑖𝑖
, 𝐹𝑖𝑗 = 1 − 𝛿𝑖𝑗
Never use these formulas for large networks!
Structure
52. 52
Microscale
◼ Centrality measures: importance of the nodes according to
different criteria
Number of neighbors (degree)
Distances to the rest of the nodes
Being in the middle of shortest paths
Importance of one node depends on the importance of the
neighbors
Frequently, only the ranking of nodes is considered
Structure
S Gómez
Centrality in networks: Finding the most important nodes
Business and Consumer Analytics: New Ideas
P. Moscato and N. J. de Vries (eds.), Springer (2019) 401-43
53. 53
Microscale
◼ Centrality measures
Closeness: how close the node is to the rest
𝑑𝑖𝑗: distance between nodes 𝑖 and 𝑗
𝐶𝐿𝑖 =
1
σ𝑗 𝑑𝑖𝑗
, 𝐶𝐿𝑖 =
𝑁
σ𝑗 𝑑𝑖𝑗
, 𝐶𝐿𝑖 =
1
𝑁 − 1
𝑗≠𝑖
1
𝑑𝑖𝑗
Structure
54. 54
Microscale
◼ Centrality measures
Betweenness: how frequently the node is in the middle of
shortest paths
𝜎𝑠𝑑: number of shortest paths between nodes 𝑠 and 𝑑
𝜎𝑠𝑑 𝑖 : number of shortest paths between nodes 𝑠 and 𝑑 that
cross node 𝑖
𝐵𝑖 =
1
𝑁 − 1 𝑁 − 2
𝑠,𝑑
𝑠≠𝑑≠𝑖
𝜎𝑠𝑑 𝑖
𝜎𝑠𝑑
Structure
55. 55
Microscale
◼ Centrality measures
Eigenvector centrality: the importance of the node is
proportional to the sum of the importance of the neighbors
𝐶𝑖
eig
=
1
𝜆
𝑗
𝑎𝑗𝑖 𝐶𝑗
eig
, 𝐴𝑪 eig
= 𝜆𝑪 eig
Structure
56. 56
Microscale
◼ Centrality measures
Katz centrality: generalization of eigenvector centrality to
account for not only the immediate neighbors
𝐶𝑖
kat𝑧
=
1
𝜆
𝑘=0
∞
𝑗
𝛼𝑘
𝐴𝑘
𝑗𝑖
, 𝑪 ka𝑡𝑧
= 𝛼𝐴𝑇
𝑪 ka𝑡𝑧
+ 𝟏
Structure
58. 58
Microscale
◼ Centrality measures
PageRank: Like eigenvector centrality, but normalizing the
importance of the neighbor by the number of links it sends
𝐶𝑖
pr
= 𝛼
𝑗
𝑎𝑗𝑖
𝐶𝑗
pr
𝑘𝑗
out
+
1 − 𝛼
𝑁
, 𝛼 = 0.85
Can be interpreted as the occupation probability of a random
walker, with a term of teleportation to scape from sinks
Structure
62. 62
Macroscale
◼ Basic global descriptors
Number of nodes 𝑁
Number of edges 𝐿
Average degree 𝑘
Density 𝜌
Average clustering coefficient 𝐶
Structure
63. 63
Macroscale
◼ Connectedness
Undirected networks
▪ Connected components
Directed networks
▪ Strongly connected components
▪ Weakly connected components
▪ In-component of a node
▪ Out-component of a node
Structure
64. 64
Macroscale
◼ Degree distribution
Most real networks have power-law degree distributions
𝑃 𝑘 ∝ 𝑘−𝛾, 2 < 𝛾 < 3
Structure
65. 65
Macroscale
◼ Degree distribution
Most real networks have power-law degree distributions
𝑃 𝑘 = 𝑎 𝑘−𝛾, 2 < 𝛾 < 3
Structure
Slope of log-log histogram
−𝛾 + 1
log 𝑃 𝑘 = −𝛾 log 𝑘 + log 𝑎
In log-log scale
66. 66
Macroscale
◼ Small-world property
In most real network, the distances are very small
Average path length
ℓ =
2
𝑁 𝑁 − 1
𝑖<𝑗
𝑑𝑖𝑗
Diameter
𝐷 = max
𝑖<𝑗
𝑑𝑖𝑗
Structure
75. 75
Models of complex networks
◼ Models
For networks
For processes on networks
For processes of networks
◼ Why models?
We have data of real networks!
We know the details of real processes on real networks!
We know the evolution of real networks!
Models
76. 76
◼ Why models? Because...
Data does not imply knowledge!
Models
77. 77
◼ Why models? Because...
Data does not imply knowledge!
Models provide
◼ Explanation
◼ Prediction
Models
78. 78
◼ Why models? Because...
Data does not imply knowledge!
Models provide
◼ Explanation
◼ Prediction
Models must be
◼ Simple (Occam’s razor)
◼ Accurate
Models
Ptolemy Tycho Brahe
Kepler
Copernicus
79. 79
◼ Why models? Because...
Data does not imply knowledge!
Models provide
◼ Explanation
◼ Prediction
Models must be
◼ Simple (Occam’s razor)
◼ Accurate
Note: Agent-based models
◼ Not simple, but more realistic
◼ Sometimes difficult (even impossible) to identify relationships
◼ Usually cannot provide explanations, even if accurate and
with good predictions
Models
80. 80
◼ Network models
To explain the appearance of topological features
◼ Power-law degree distribution, small-world property,
clustering, community structure, etc.
Models
81. 81
◼ Network models
To explain the appearance of topological features
◼ Power-law degree distribution, small-world property,
clustering, community structure, etc.
To investigate the relationship between topology and
function
◼ Which features are needed for a certain phenomenon?
Models
82. 82
◼ Network models
To explain the appearance of topological features
◼ Power-law degree distribution, small-world property,
clustering, community structure, etc.
To investigate the relationship between topology and
function
◼ Which features are needed for a certain phenomenon?
To understand processes on networks
◼ Diffusion, epidemic spreading, rumors, innovations,
collaboration, competition, evolutionary games, routing,
congestion, synchronization, etc.
Models
83. 83
◼ Network models
To explain the appearance of topological features
◼ Power-law degree distribution, small-world property,
clustering, community structure, etc.
To investigate the relationship between topology and
function
◼ Which features are needed for a certain phenomenon?
To understand processes on networks
◼ Diffusion, epidemic spreading, rumors, innovations,
collaboration, competition, evolutionary games, routing,
congestion, synchronization, etc.
To understand processes of networks
◼ Network formation, evolution, interaction, etc.
Models
86. 86
Regular networks
◼ Traditional networks used in physics and
engineering
◼ Sometimes allow analytical solutions
◼ Discretization of continuous space
Regular networks
92. 92
Complex network models
◼ Models for these properties
Degree distribution
Average path length
Clustering
Communities
Other
Complex network models
93. 93
Models according to degree distribution
◼ Erdős-Rényi model (ER)
◼ Barabási-Albert model (BA)
◼ Configuration model (CM)
Complex network models
94. 94
Models according to degree distribution
◼ Erdős-Rényi model (ER)
◼ Barabási-Albert model (BA)
◼ Configuration model (CM)
Complex network models
95. 95
◼ Erdős-Rényi model (ER)
Model GN,K by Erdős & Rényi (1959)
◼ 𝑁: number of nodes
◼ 𝐾: number of edges (0 ≤ 𝐾 ≤ 𝑁(𝑁 − 1)/2)
◼ Each edge connects a randomly selected (and not previously
connected) pair of nodes
Model GN,p by Gilbert (1959)
◼ 𝑁: number of nodes
◼ 𝑝: probability of having an edge (0 ≤ 𝑝 ≤ 1)
◼ Each pair of nodes has a probability 𝑝 of having an edge
Complex network models
97. 97
◼ Erdős-Rényi model (ER)
Relationship between GN,K and GN,p
◼ GN,p to GN,K
◼ GN,K to GN,p
Property
◼ Almost surely, connected network if
Complex network models
98. 98
◼ Erdős-Rényi model (ER)
Degree distribution
◼ Binomial
◼ Poisson, in the limit while constant
Complex network models
99. 99
Models according to degree distribution
◼ Erdős-Rényi model (ER)
◼ Barabási-Albert model (BA)
◼ Configuration model (CM)
Complex network models
100. 100
◼ Barabási-Albert model (BA)
Based on growth and preferential attachment (1999)
◼ 𝑁: number of nodes
◼ 𝑚0: number of initial nodes (𝑚0 ≤ 𝑁)
◼ 𝑚: number of edges for each new node (𝑚 ≤ 𝑚0)
◼ The network begins with an initial small connected network
containing 𝑚0 nodes
◼ New nodes are added until the network has the desired 𝑁
nodes (growth)
◼ Each new node establishes 𝑚 edges to the current available
nodes
◼ The probability 𝑝𝑖 that each of the 𝑚 edges connects to node 𝑖
is proportional to its current number of links 𝑘𝑖 (preferential
attachment)
Complex network models
101. 101
◼ Barabási-Albert model (BA)
Degree distribution
◼ Power-law (scale-free) with exponent = 3
Complex network models
102. 102
◼ Barabási-Albert model (BA)
Note
◼ Both growth and preferential attachment are needed to obtain
the SF degree distribution
History
◼ Yule (1925): preferential attachment to obtain SF degree
distribution
◼ Simon (1955): application of modern master equation method
◼ Price (1976): application to the growth of networks
◼ Barabási & Albert (1999): rediscovery, name of preferential
attachment, popularity
Complex network models
104. 104
Models according to degree distribution
◼ Erdős-Rényi model (ER)
◼ Barabási-Albert model (BA)
◼ Configuration model (CM)
◼ Interpolating model between ER and BA
Complex network models
105. 105
◼ Configuration model (CM)
Build network given degree sequence
◼ 𝑁: number of nodes
◼ 𝑃(𝑘): degree distribution
◼ Assign a random degree 𝑘𝑖 to each node according to the
given degree distribution 𝑃(𝑘)
◼ Create a vector with all the slots (“half edges”)
◼ Connect randomly pairs of slots
◼ Could be used to rewire networks
◼ Could be used to generate networks with scale-free (SF)
degree distribution for any value of the exponent 𝛾 > 2
Complex network models
106. 106
◼ Configuration model (CM)
Algorithm
Complex network models
◼ Random assignment
of degrees according
to P(k)
◼ Vector of slots
◼ Random permutation
of the vector of slots
◼ Connection of slots
107. 107
◼ Configuration model (CM)
Details
◼ The number of slots must be even (2𝐿)
◼ Probability pij of connecting nodes i and j
◼ Multi-edges and self-loops may appear
Complex network models
108. 108
◼ Configuration model (CM)
Details
◼ For large N, the number of multi-edges and self-loops is
negligible if and are finite
◼ For scale-free degree distributions , the second
moment diverges if the exponent is 𝛾 ∈ 2,3
Modify the algorithm to avoid the presence of multi-edges and
self-loops
Introduce a cut-off in P(k) scaling as
◼ Algorithms to find a random permutation
Fisher–Yates shuffle (1938)
Durstenfeld (1964) / Knuth (1969)
Complex network models
109. 109
◼ Configuration model (CM)
Generalization
◼ Configuration model to build networks with desired degree-
degree correlations P(k,k’)
Main developers and theory
◼ Bekessy, Bekessy & Komlos (1972)
◼ Bender & Canfield (1978)
◼ Bollobás (1980)
◼ Wormald (1981)
◼ Molloy & Reed (1995)
Complex network models
110. 110
Models according to average path length
◼ Watts-Strogatz model (WS)
Complex network models
111. 111
◼ Watts-Strogatz model (WS)
Based on regular network and random rewirings (1998)
◼ 𝑁: number of nodes
◼ 𝑘: mean degree, even integer (𝑘 < 𝑁)
◼ 𝑝: rewiring probability
◼ Nodes initially in a regular ring lattice
◼ Each node connects to its 𝑘 nearest neighbors, 𝑘/2 on each
side (clockwise and counterclockwise)
◼ For each node, rewire each clockwise original edge with
probability 𝑝 to a new random destination (multi-edges and
self-loops not allowed)
Regular ER
0 𝑝 1
Complex network models
114. 114
◼ Watts-Strogatz model (WS)
Conclusion
◼ Long range edges explain Small-World property
Variants
◼ Adding long range edges instead of rewiring
◼ Different initial regular networks
Complex network models
115. 115
Summary
◼ Complex networks everywhere
◼ Complex networks share common structural
properties
◼ Representation of complex networks
◼ Overview of structural properties and their analysis
◼ Models of complex networks
Structure of complex networks
116. 116
Thank you for your attention!
◼ Contact
sergio.gomez@urv.cat
http://deim.urv.cat/~sergio.gomez
Structure of complex networks