Network Randomizations

R ile Ağ Analizi

James Curley

Associate Professor, University of Texas at Austin

Random graphs

erdos.renyi.game(n = gorder(g), p.or.m = edge_density(g), type = "gnp")
R ile Ağ Analizi

Random graphs & randomization tests

  1. Generate 1000 random graphs based on the original network - e.g. with the same number of vertices and approximate density.

  2. Calculate the average path length of the original network.

  3. Calculate the average path length of the 1000 random networks.

  4. Determine how many random networks have an average path length greater or less than the original network's average path length.

R ile Ağ Analizi

Generate 1000 random graphs:

gl <- vector('list',1000)

for(i in 1:1000){
    gl[[i]] <- erdos.renyi.game(
                    n = gorder(g), 
                    p.or.m = edge_density(g), 
                    type = "gnp"
                     ) 
}

Calculate average path length of 1000 random graphs:

gl.apls <- unlist(
  lapply(gl, mean_distance, directed = FALSE) 
)
R ile Ağ Analizi

Comparing to the original network

hist(gl.apls, breaks = 20)

abline(
  v = mean_distance(
    g, directed=FALSE
    ),
      col = "red", 
      lty = 3, 
      lwd = 2
)

R ile Ağ Analizi

Let's practice!

R ile Ağ Analizi

Preparing Video For Download...