https://www.markvanderloo.eu/files/share/uros2025networks.zip
Or go to markvanderloo.eu/publications, find the tutorial under conference contributions and click on the materials link
See exercise_1.R
Each time, check the output and interpret together with your neighbour.
See ?igraph.plotting for all parameters.
Try different layout functions. See ?layout_ for options.
Create a ‘nice’ plot of the airport connections.
Nodes within a cluster are more connected to each other than to others.
A clustering is a partition of nodes that maximizes modularity.
Choose a subset of nodes.
\[ C = \frac{\textrm{# links between the selected nodes}} {\textrm{# all links with selected nodes}} \]
Partition the nodes into \(m\) subsets. The modularity of this partition is given by
\[ Q = \sum_{i=1}^m (C_i - C^0_i), \]
where \(C^0_i\) is a correction based on the expected number of links if they were assigned at random.
There are \(2^{|V|}\) ways to partition a graph.
Many heuristic algorithms, including
See exercise_2.R
cl object. What are it’s elements?The closeness of a node is the reciprocal of the sum over the distances to all other nodes.
\[ \textrm{closeness}(v) = \frac{1}{\sum_{w\in V(g)}\textrm{distance}(v,w)} \]
Note For directed networks, there is a version for incoming and outgoing distances.
The betweenness of a node measures how often a node appears in a shortest path between two nodes.
\[ \textrm{betweenness}(v) = \sum_{s\not=t\in V(g)} \frac{\textrm{# shortest paths from }s\textrm{ to }t\textrm{ via }v } {\textrm{# shortest paths from }s\textrm{ to }t} \]
Your centrality equals the sum over centralities of your neighbours. This leads to the following equation.
\[ \boldsymbol{Ac}=\lambda\boldsymbol{c}. \]
Where \(A_{ij}=1\) when \(i\) and \(j\) are connected (0 otherwise), \(\mathbf{c}\) the vector of centralities, and \(\lambda\) the eigenvalues.
Note. There are variants for directed graphs
A node is important when important neighbours point to you
\[ \textrm{pagerank}(v) = (1-d) + d\sum_{w\to v}\textrm{pagerank}(w) \]
Where \(d\in[0,1]\). Originally \(d=0.85\)
Note Originally developed for directed graphs (like the internet).
See exercise_3.R