Professional Documents
Culture Documents
CN 2016 Lecture1
CN 2016 Lecture1
@ c s . a a l t o . f i
CS-E5740
Complex Networks
Lectures 1-2:
Jari Saramäki
jari.saramaki@aalto.fi
@JariSaramaki
Lectures 3-6:
Assistants: Mikko Kivelä
Onerva Korhonen mikko.kivela@aalto.fi
Tuomas Alakörkkö www.mkivela.com
Sara Heydari
Elisa Ryyppö
fall 2016
Goals
After the course, you should
• No exam
TU1
Maari
Y342a Y342a MyCourses
M
Continuous feedback!
metabolic
protein interaction networks
networks
Everything is a network
nerve cells
the Internet
transport networks
What can network science tell us?
Internet human brain
- WHY IS THE INTERNET ALWAYS
ON, WHY DOESN’T IT FAIL?
- WHY IS IT SO HARD TO
ERADICATE ELECTRONIC VIRUSES?
- HOW AND WHY DO WE THINK?
world trade
Hagmann P, Kurant M,
Gigandet X, Thiran P, Wedeen
VJ, et al. (2007) Mapping
- WHAT DOES GLOBALIZATION MEAN Human Whole-Brain
Structural Networks with
IN PRACTICE?
Diffusion MRI. PLoS ONE 2
- HOW CAN DEVELOPING COUNTRIES
(7): e597. !
DEVELOP FURTHER?
What can network science tell us?
disease spreading
-HOW DO DISEASES SPREAD?
‣ Interactions of different
direction directed networks
‣ Time-dependent interactions
temporal networks Vertex Edge
person friendship
‣ Interactions of different type
multiplex networks neuron synapse
WWW hyperlink
• Vertex = node company ownership
(synonyms), edge = link gene regulation
What is a link?
...that is not always straightforward.
Protein 2
How do we
deal with
such things? H. Jeong, S.P. Mason, A.-L. Barabasi, Z.N. Oltvai, Nature 411, 41-42 (2001)
The network approach
1) Make empirical observations
2) Try to explain observations
2.1) Choose right level of coarse-graining
(interacting elements = nodes, interactions = links)
multigraph
simple graphs
Walks and paths
Naming conventions for walks and paths are varying (alternative names in
parenthesis)
• walk (path) is a sequence of vertices where each consecutive pair is con-
nected by an edge.
• distance (geodesic distance), dij , is the shortest path length between nodes
vi and vj .
• diameter, d, is the largest distance in the network: d = maxi,j2V dij .
i
Path {i,j,k} has length 2. This is the
j distance between i and k, and also
happens to be the diameter of this network
k
Subgraphs, cliques
A subgraph G⇤ = (V ⇤ , E ⇤ ) consists of some subset of nodes, V ⇤ ✓ V , together
with some subset of edges between those nodes. Induced subgraph contains all
edges between the nodes V ⇤ .
Subgraph: E ⇤ ✓ {(vi , vj ) 2 E | vi , vj 2 V ⇤ }
Induced subgraph: E ⇤ = {(vi , vj ) 2 E | vi , vj 2 V ⇤ }
A clique is a subgraph where all nodes are linked to all other nodes.
this is a 3-clique!
j
i i
l
m j j k
l
k k m j
Note that because there is no path between nodes that belong to di↵erent
components, their distance is undefined (or infinite).
i i
m j m j
l l
k k
this graph is connected this graph has two components,
(i,j,m) and (l,k)
Directed networks: paths, components
Degree
the degree
If there is an edge (vi , vj ) 2 E, of j is 4
i
• vi and vj are adjacent,
m j
• vi is a neighbour of vj , l j’s neighbours
k are (i,k,l,m)
• the edge is incident to vi and vj .
The degree ki of vertex vi is the number of edges it is incident to. (This is num-
ber of neighbours in simple graphs. Loops are counted twice in multigraphs.)
For directed networks, one can consider separate in- and out-degrees. The in-
degree ki,in is defined as the number of edges leading to vi and the out-degree
ki , out as the number of edges leading out from vi .
P
The average degree hki of a network is hki = i ki /N = 2m/N .
Degree distribution
The degree distribution P (k) is one of the central concepts in network analysis.
It answers the questions ”if a random node is picked, what is the probability
that its degree is k?” That is,
P (k) = Nk /N ,
m 2m
⇢= = N (N 1) .
(N2 )
In real-world networks, the edge density is usually low, i.e. the networks are
sparse.
2⇥1
Cj = 4⇥3 = 0.1666
i
m j
l this metabolic network has a high
k 2⇥1 average clustering coefficient
Ck = 2⇥1 =1 because of the dense subgraphs.
Special graphs
• A tree with
N vertices always
has m=N-1edges.
a forest
Special graphs
A = AT N
X
ki,in = aij
N
X N
X i=1
ki = aij = aij XN
j=1 i=1 ki,out = aij
j=1
N
X N X
X N
N
X N
X
2m = ki = aij
i=1 i=1 j=1
m= ki,in = ki,out
i=1 i=1
Part III:
Random networks
Erdős-Rényi networks
Erdős-Rényi networks: Two versions:
• A maximally random • G(N,p): connect each pair of
ensemble of networks of vertices with probability p
given size
• G(N,m): place m edges
Construction: randomly on the network
• Connect N vertices • these define ensembles of
randomly networks
N = 10
p = 1/5
<k> = 1.8
Pál Erdős
(1913-1996)
Erdős, P.; Rényi, A. (1959). "On Random Graphs. I.". Publicationes Mathematicae 6: 290–297.
Ensemble G(N,p) with N =3
N=3, p=1/3
ππjj == probability
probability of
of
realization
realization ofof network
network jj
<kjj>> == avg
<k avg degree
degree in
in jj
π1 ~ 0.3 π2 ~ 0.15 π3~ 0.15 π4~ 0.15
<k1>=0 <k2>=2/3 <k3>=2/3 <k4>=2/3
0.07
π5 ~ 0.15 0.07
π6 ~ 0.15 π7 ~ 0.15
0.07 π8 ~ 0.04
<k5>=4/3 <k6>=4/3 <k7>=4/3 <k8>=2
0.04 hki = 30 k!
0.03
that is, P (k) = Poisson(hki).
0.02
0.01
0.00
0 10 20 30 40 50 60 70
k
Average shortest paths & dimensionality
` / ln N
1 X
`= dij
N (N 1) i,j
` / ln N 1/d
`/N ` / N (1/2)
Components in E-R networks
N
Components in E-R networks
<s>
<s>==average
averagenumber
number
• Boccaletti et al., Complex networks: Structure and dynamics, Physics Reports,Vol. 424, No.
4-5. (February 2006)
(online at http://www.sciencedirect.com/science/article/pii/S037015730500462X)
• P. Holme & J. Saramäki, Temporal Networks, Physics Reports 519, 97-125 (2012)
(online at http://arxiv.org/abs/1108.1780)
• M. Kivelä et al., Multilayer Networks, Journal of Complex Networks 2(3) 203-271 (2014)
(online at http://comnet.oxfordjournals.org/content/early/2014/07/14/comnet.cnu016 )
Extra reading material
Python and Networkx, online documentation and tutorials:
• http://docs.python.org/
• http://en.wikibooks.org/wiki/A_Beginner’s_Python_Tutorial
• http://networkx.github.io/documentation/latest/tutorial/
• http://docs.scipy.org/doc/
Other network software (not used in the course, but good to know):
• http://snap.stanford.edu/
• http://graph-tool.skewed.de/
• http://github.com/CxAalto/
• http://www.boost.org/doc/libs/1_61_0/libs/graph/