small_world_sigma#
- graph_tool.structure.small_world_sigma(g, niter=100, nrand=10)[git][source]#
Return the small-world coefficient sigma of a graph.
- Parameters:
- g
Graph Connected undirected graph.
- niter
int(optional, default:100) Number of edge swaps per edge in each random reference.
- nrand
int(optional, default:10) Number of random references averaged.
- g
- Returns:
- sigma
float The coefficient \(\sigma = (C/C_r)/(L/L_r)\).
- sigma
See also
small_world_omegaSmall-world coefficient omega
graph_tool.generation.random_rewire_connectedDegree-preserving randomization
graph_tool.clustering.global_clusteringGlobal clustering coefficient
average_shortest_path_lengthAverage distance between pairs of vertices
Notes
\(C\) is the global clustering coefficient (transitivity, see
global_clustering()) and \(L\) the average shortest path length (seeaverage_shortest_path_length()), and \(C_r\), \(L_r\) are their averages over random references with the same degrees (seerandom_rewire_connected()) [humphries-network-2008]. A graph is often called ” small world “ if \(\sigma > 1\).The reference graphs are generated in parallel, each with the random number generator of its thread, so that the result depends on the number of threads, besides the seed.
References
[humphries-network-2008]Mark D. Humphries and Kevin Gurney, “Network ‘small-world-ness’: a quantitative method for determining canonical network equivalence”, PLoS ONE 3, e0002051 (2008), DOI: 10.1371/journal.pone.0002051 [sci-hub, @tor]
Examples
>>> g = gt.collection.data["karate"] >>> print(gt.small_world_sigma(g, niter=10, nrand=5)) 1.05...