Agent-based modelling, Konstanz, 2024
11 June 2024
gplot
function from GraphPlot.jl:rem_edge!
can be used to remove existing connections:add_edge!
calls quickly becomes tedious…DiGraph
typeWhat kind of network do the following adjacency matrices represent? Think about it first (draw with your “mind’s eye”), then implement the code and plot the graphs.
erdos_renyi
function can be used:Open Wikipedia on the page for Switzerland. Then, using only links on the page, try to navigate to the page for Albert Einstein.
How many links do you need to go through to reach the destination?
One possible path:
Switzerland
\(\quad\to\) German
\(\quad\quad\to\) Germany
\(\quad\quad\quad\to\) Education in Germany
\(\quad\quad\quad\quad\to\) Max Planck Institute for Plasma Physics
\(\quad\quad\quad\quad\quad\to\) Physics
\(\quad\quad\quad\quad\quad\quad\to\) Albert Einstein
That’s 6 links.
watts_strogatz(n, k, β)
n
: number of nodesk
: initial degree of every nodeβ
: rewiring probabilityLow clustering for node 1:
High clustering for node 1:
local_clustering_coefficient
You will need MatrixMarket.jl and GraphPlot.jl documentation