Learn R Programming

L0ggm (version 0.1.2)

smallworldness: Computes Various Small-Worldness Metrics

Description

Computes the small-worldness of a network using one of five methods. All simulation-based methods generate degree-preserving random graphs as the null baseline. The lattice reference network (where required) is constructed using proxswap_lattice, which produces a degree-preserving ring lattice that maximizes the clustering coefficient

Usage

smallworldness(
  network,
  lattice,
  method = c("analytical", "omega", "S", "SWI", "SWP"),
  weighted = FALSE,
  iter = 100
)

Value

Numeric (length = 1). The small-worldness value computed using the chosen method:

  • "analytical" and "S" --- \(S > 1\) indicates small-world structure

  • "omega" --- Values near \(|\omega| < 0.50\) indicate small-world structure (ranges between -1 and 1)

  • "SWI" --- Values close to 1 indicate strong small-world structure; values near 0 indicate lattice-like or random-like structure (ranges between 0 and 1)

  • "SWP" --- Values \(\phi > 0.60\) indicate strong small-world structure (ranges between 0 and 1)

Arguments

network

Matrix or data frame. A square, symmetric numeric matrix representing a network (e.g., partial correlations). Absolute values are taken internally, so signed weights are handled automatically. Non-zero off-diagonal entries are treated as edges.

lattice

Matrix (optional). A pre-computed lattice adjacency matrix to use as the regular-network reference for the "omega" and "SWP" methods. If not provided, a lattice is generated automatically via proxswap_lattice. Ignored by "analytical" and "S"

method

Character (length = 1). The method used to compute small-worldness. Defaults to "SWP". Available options:

  • "analytical" --- Computes the Humphries & Gurney (2008) \(S\) metric using closed-form approximations for the Erdős–Rényi random graph baseline: $$S = \frac{C / C_{\text{rand}}}{L / L_{\text{rand}}}$$ where \(C_{\text{rand}} \approx \langle k \rangle / n\) and \(L_{\text{rand}} \approx \ln(n) / \ln(\langle k \rangle)\). No random graphs are generated. The weighted argument is ignored. Values greater than 1 indicate small-world structure

  • "S" --- Computes the Humphries & Gurney (2008) \(S\) metric by simulation. Random graphs are generated under the Erdős–Rényi model (sample_gnm) with the same number of nodes and edges as network. The empirical and random clustering coefficients both use global transitivity (\(C^\Delta\)). When weighted = TRUE, edge weights are reassigned to each random graph topology via assign_weights. Values greater than 1 indicate small-world structure

  • "omega" --- Computes the \(\omega\) metric of Telesford et al. (2011): $$\omega = \frac{L_{\text{rand}}}{L} - \frac{C}{C_{\text{latt}}}$$ Random graphs preserve the degree sequence via edge-switching (sample_degseq, method = "edge.switching.simple"). The clustering coefficient uses average local transitivity (\(\bar{C}\)). Note: Telesford et al. (2011) defined and validated \(\omega\) exclusively on binary, unweighted networks. When weighted = TRUE, edge weights are reassigned to each random graph topology via assign_weights and the lattice is constructed with weighted = TRUE, following the approach of Muldoon et al. (2016); this is an extension beyond the original formulation. Values near zero indicate small-world structure; negative values indicate lattice-like structure; positive values indicate random-like structure. Bounded in \([-1, 1]\)

  • "SWI" --- Computes the Small-World Index of Neal (2015): $$\text{SWI} = \frac{L - L_{\text{latt}}}{L_{\text{rand}} - L_{\text{latt}}} \times \frac{C - C_{\text{rand}}}{C_{\text{latt}} - C_{\text{rand}}}$$ Each term captures where the observed network's path length and clustering coefficient fall within the lattice-to-random range, so that SWI = 1 only when \(L = L_{\text{rand}}\) and \(C = C_{\text{latt}}\) simultaneously. Because this ideal is mathematically unachievable in a finite network, SWI = 1 is a conceptual upper bound rather than a realisable value. Random graphs preserve the degree sequence via edge-switching (sample_degseq, method = "edge.switching.simple"). The clustering coefficient uses average local transitivity (\(\bar{C}\)). When weighted = TRUE, edge weights are reassigned to each random graph topology and the lattice is constructed with weighted = TRUE. Note: SWI and SWP were developed independently and concurrently; both apply the same double-normalisation framework but differ in how the two deviation terms are combined (product vs. Euclidean distance). Values close to 1 indicate strong small-world structure; values near 0 indicate lattice-like or random-like structure. Bounded in \([0, 1]\)

  • "SWP" --- Computes the Small-World Propensity of Muldoon et al. (2016): $$\phi = 1 - \sqrt{\frac{\Delta_C^2 + \Delta_L^2}{2}}$$ where \(\Delta_C = (C_{\text{latt}} - C) / (C_{\text{latt}} - C_{\text{rand}})\) and \(\Delta_L = (L - L_{\text{rand}}) / (L_{\text{latt}} - L_{\text{rand}})\). Both \(\Delta_C\) and \(\Delta_L\) are bounded to \([0, 1]\), guaranteeing \(\phi \in [0, 1]\). Random graphs preserve the degree sequence via edge-switching. The clustering coefficient uses average local transitivity (\(\bar{C}\)). When weighted = TRUE, edge weights are reassigned to each random graph topology via assign_weights and the lattice is constructed with weighted = TRUE. Values close to 1 indicate strong small-world structure; a pragmatic threshold of \(\phi_T = 0.60\) has been suggested

weighted

Logical (length = 1). Whether to compute small-worldness on the weighted network. When TRUE, edge weights from network are preserved for the empirical graph and reassigned to random and lattice graph topologies via assign_weights, following Muldoon et al. (2016). When FALSE (default), all graphs are treated as binary. Ignored when method = "analytical"

iter

Numeric (length = 1). Number of random graphs to generate when estimating the null baseline. Defaults to 100. Ignored when method = "analytical". Higher values produce more stable estimates at the cost of computation time

Author

Alexander P. Christensen <alexpaulchristensen@gmail.com>

References

omega
Telesford, Q. K., Joyce, K. E., Hayasaka, S., Burdette, J. H., & Laurienti, P. J. (2011). The ubiquity of small-world networks. Brain Connectivity, 1(5), 367--375.

S and analytical
Humphries, M. D., & Gurney, K. (2008). Network 'small-world-ness': A quantitative method for determining canonical network equivalence. PLoS ONE, 3(4), e0002051.

SWI
Neal, Z. P. (2015). Making big communities small: Using network science to understand the ecological and behavioral requirements for community social capital. American Journal of Community Psychology, 55(3), 369--380.

SWP
Muldoon, S. F., Bridgeford, E. W., & Bassett, D. S. (2016). Small-world propensity and weighted brain networks. Scientific Reports, 6(1), 22057.

Examples

Run this code
# Get network
network <- network_estimation(basic_smallworld)

# Compute SWP (default)
swp <- smallworldness(network)

# Compute omega
omega <- smallworldness(network, method = "omega")

# Compute analytical S
S <- smallworldness(network, method = "analytical")

# Compute simulated S
S_sim <- smallworldness(network, method = "S")

# Compute SWI
swi <- smallworldness(network, method = "SWI")

# Compute weighted SWP
swp_w <- smallworldness(network, weighted = TRUE)

# Compute weighted omega
omega_w <- smallworldness(network, method = "omega", weighted = TRUE)

Run the code above in your browser using DataLab