Professional Documents
Culture Documents
Networks
Analysis
Complex
Networks Basics
Rushed Kanawati
kanawati@sorbonne-paris-nord.fr
https://www.kanawati.fr
Plan
Iris dataset :
!
A graph G = < 𝑉 𝐺 , 𝐸 𝐺 ⊆ 𝑉 𝐺 >
V(G) : set of Vertices (actors, nodes, sites, …)
nG = | V(G) | is the order of G
E(G) : set of Edges (links, ties, arcs, bonds …)
E(G) = { 𝑥" , 𝑥# : 𝑥" , 𝑥# ∈ 𝑉 𝐺 ∧ 𝑥" ≠ 𝑥# } No loops, neither multi-edges
𝑉 𝐺 = 1,2,3,4,5
𝑛! = 5
𝑚! = 5
08/01/2021 SNA - Chapter 1 Complex Networks Basics (R. Kanawati) 18
Graph: igraph code
>library(igraph)
>g <- graph(edges=c(1,2,2,3,1,3,3,4,2,4), n=5,
directed=FALSE)
>vcount(g) ## length(V(g))
[1] 5
>ecount(g) ## length(E(g))
[1] 4
>plot(g, vertex.color="gold", edge.curved=TRUE,
layout= layout_in_circle)
https://en.wikipedia.org/wiki/Hyper
graph
Throught this course we generally consider undirected binary graphs unless otherwise explicitly cited
Degree of vertex 𝑣
𝑑" = |Γ 𝑣 |
∑!∈# $ &! ()$
𝛿#"$ 𝐺 = = Average degree of G
'$ '$
Γ 2 = {1,3,4}
𝑑( = Γ 2 =3
> neighbors(g,2)
+ 3/5 vertices, from 18848b1:
[1] 1 3 4
> degree(g,2)
[1] 3
> degree(g)
[1] 2 3 3 2 0
> average.path.length(g)
[1] 1.166667
|{𝑣8 ∈ 𝑉 𝐺 : 𝑑9! = 𝑘|
𝑃 𝑘 =
𝑛!
Regular graph Random graph Scale-Free graph
2 𝑚!
𝜌(𝐺) =
𝑛! (𝑛! − 1)
> g <- graph(edges=c(1,2,2,3,1,3,3,4,2,4), n=5, directed=FALSE)
> graph.density(g) 𝜌(𝐺) = 0.5
[1] 0.5
𝑑 1,4 = 2
1212! 2 121 21 4
𝛿 𝐺 = = = 1.166667
3 3
>paths<-all_simple_paths(g,1,4)
> paths[lapply(paths,length)==4] #𝜎 % 1,4
[[1]]
+ 4/5 vertices, from 86325cf:
[1] 1 2 3 4
[[2]]
+ 4/5 vertices, from 86325cf:
[1] 1 3 2 4
$res
$res[[1]]
[1] 1 3 4
$res[[2]]
[1] 1 2 4
[,1]
[1,] 2
> eccentricity(g)
[1] 2 1 1 2 0
> diameter(g) # Attention g is unconnected!
[1] 2
> radius(g)
[1] 0
> is_connected(g)
[1] FALSE
> clusters(g)
$membership
[1] 1 1 1 1 2
$csize
[1] 4 1
$no
[1] 2
Probability of having a link between two nodes that share a common neighbour
What is the probability that two friends of a given person are friends themselves ?
01100
10110
𝐴, = 11010
01100
00000
11000
10110
𝐵, = 01100
00011
00000
The IJ-form of 𝐴$
1,2
1,3
2,3
2,4
3,4
- https://www.oakland.edu/enp/
- Diameter of 2-Erdös is 5
Density Diameter
Clustering Degree
coefficient Distribution
𝜌B 𝐷𝑖𝑎𝑚 𝐺
2 10H" 11
CC
9 10H!
𝜌B 𝐷𝑖𝑎𝑚 𝐺
10H" 7
CC
3 10H!
𝜌% 𝐷𝑖𝑎𝑚 𝐺
10&' 24
CC
0.67
𝜌(𝐺)
𝐷𝑖𝑎𝑚 𝐺
0.54
3
CC
0.65
𝜌(𝐺)
𝐷𝑖𝑎𝑚 𝐺
2H"
28
CC
0.47
𝜌(𝐺) 𝐷𝑖𝑎𝑚 𝐺
0.052 7
CC
0.97
Public sites accessibility in Bourget District, Paris Area
08/01/2021 SNA - Chapter 1 Complex Networks Basics (R. Kanawati) 52
(Random)
Networks
Models
𝐺 I,J 𝐺 I,X
- Low diameter
- Sparse
- Homogeneous degree distribution
- Low clustering coefficient
- Low diameter
- Sparse
- Heterogenous degree distribution
Force a heterogenous degree distribution,
- Low clustering coefficient
with random linking
Strogatz-Watts model
https://en.wikipedia.org/wiki/Duncan_J._Watts
0 𝑝
1
08/01/2021 SNA - Chapter 1 Complex Networks Basics (R. Kanawati) 56
Strogatz-Watts model
- Low diameter
- Sparse
- Homogeneous degree distribution
- High clustering coefficient
- Low diameter
- Sparse
- Heterogenous degree distribution
- Very low clustering coefficient
Networks dynamics
Dynamics on networks
Complex networks:
• are everywhere
• are not random
• are not captured by a simple mathematical model
• share a set of untrivial topological features :
• sparsity
• low diameter
• heterogeneous degree distribution
• high clustering coefficient
• community structure
• analysis can allow gaining insights in a wide range of domains.