# NOT RUN {
set.seed(1)
# a regular lattice. Even if the small-worldness is higher than three, the average path length is
# much higher than that of random networks.
regnet<-igraph::watts.strogatz.game(dim=1, size=1000, nei=10, p=0, loops=FALSE, multiple=FALSE)
smallworldness(regnet, B=10)
# }
# NOT RUN {
# a small-world network: the transitivity is much higher than random, the average path length is
# close to that of random networks
swnet<-igraph::watts.strogatz.game(dim=1, size=1000, nei=10, p=.1, loops=FALSE, multiple=FALSE)
smallworldness(swnet, B=10)
# a pseudorandom network: both the average path length and the transitivity are similar to random
# networks.
rndnet<-igraph::watts.strogatz.game(dim=1, size=1000, nei=10, p=1, loops=FALSE, multiple=FALSE)
smallworldness(rndnet, B=10)
# }
Run the code above in your browser using DataLab