Learn R Programming

qgraph (version 1.6.9)

smallworldness: Compute the small-worldness index.

Description

Compute the small-worldness index (Humphries & Gurney, 2008) relying on the global transitity of the network (Newman, 2003) and on its average shortest path length.

Usage

smallworldness(x, B = 1000, up = 0.995, lo = 0.005)

Arguments

x

A graph. Can be a qgraph object object, an igraph object, an adjacency matrix, a weight matrix and an edgelist, or a weighted edgelist.

B

The number of random networks.

up

The upper quantile.

lo

the lower quantile.

Value

smallworldness

the "small-worldness" index proposed by Humphries & Gurney (2008)

trans_target

the global transitivity of the target network (Newman, 2003)

averagelength_target

the average shortest path length in the target network

trans_rnd_M

the average transitivity in the B random networks

trans_rnd_lo

the lo quantile of the transitivity in the B random networks

trans_rnd_up

the up quantile of the transitivity in the B random networks

averagelength_rnd_M

the average shortest path length in the B random networks

averagelength_rnd_lo

the lo quantile of the shortest path length in the B random networks

averagelength_rnd_up

the up quantile of the shortest path length in the B random networks

Details

The function computes the transitivity of the target network and the average shortest path length. Then it computes the average of the same indices on B random networks. The small-worldness index is then computed as the transitivity (normalized by the random transitivity) over the average shortest path length (normalized by the random average shortest path length). The lo and up quantiles of the distribution of the random networks are also returned for both the transitivity and the average shortest path length.

A network can be said "smallworld" if its smallworldness is higher than one (a stricter rule is smallworldness>=3; Humphries & Gurney, 2008). To consider a network as "smallworld", it is also suggested to inspect that the network has a transitivity substantially higher than comparable random networks and that its average shortest path length is similar or higher (but not many times higher) than that computed on random networks. Edge weights, signs and directions are ignored in the computation of the indices.

References

Costantini, G., Epskamp, S., Borsboom, D., Perugini, M., Mottus, R., Waldorp, L., Cramer, A. O. J., State of the aRt personality research: A tutorial on network analysis of personality data in R. Manuscript submitted for publication.

Humphries, M. D., & Gurney, K. (2008). Network "small-world-ness": a quantitative method for determining canonical network equivalence. PLoS One, 3(4), e0002051.

Newman, M. E. J. (2003). The structure and function of complex networks*. SIAM Review, 45(3), 167<U+2013>256.

Examples

Run this code
# 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