small_world_sigma

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:
gGraph

Connected undirected graph.

niterint (optional, default: 100)

Number of edge swaps per edge in each random reference.

nrandint (optional, default: 10)

Number of random references averaged.

Returns:
sigmafloat

The coefficient \(\sigma = (C/C_r)/(L/L_r)\).

See also

small_world_omega

Small-world coefficient omega

graph_tool.generation.random_rewire_connected

Degree-preserving randomization

graph_tool.clustering.global_clustering

Global clustering coefficient

average_shortest_path_length

Average distance between pairs of vertices

Notes

\(C\) is the global clustering coefficient (transitivity, see global_clustering()) and \(L\) the average shortest path length (see average_shortest_path_length()), and \(C_r\), \(L_r\) are their averages over random references with the same degrees (see random_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...