small_world_omega#
- graph_tool.topology.small_world_omega(g, niter=5, nrand=10)[git][source]#
Return the small-world coefficient omega of a graph.
- Parameters:
- g
Graph Connected undirected graph.
- niter
int(optional, default:5) Number of edge swaps per edge in each reference graph.
- nrand
int(optional, default:10) Number of reference graphs averaged.
- g
- Returns:
- omega
float The coefficient \(\omega = L_r/L - C/C_l\).
- omega
See also
small_world_sigmaSmall-world coefficient sigma
graph_tool.generation.random_rewire_connectedDegree-preserving randomization
graph_tool.generation.random_rewire_latticeRewiring towards a ring lattice
Notes
\(L\) is the average shortest path length and \(C\) the average local clustering coefficient; \(L_r\) is averaged over random references and \(C_l\) over lattice references with the same degrees (see
random_rewire_connected()andrandom_rewire_lattice()) [telesford-ubiquity-2011]. It is close to zero for small-world graphs, negative for lattice-like and positive for random-like ones.References
[telesford-ubiquity-2011]Qawi K. Telesford, Karen E. Joyce, Satoru Hayasaka, Jonathan H. Burdette and Paul J. Laurienti, “The ubiquity of small-world networks”, Brain Connectivity 1, 367-375 (2011), DOI: 10.1089/brain.2011.0038 [sci-hub, @tor]
Examples
>>> g = gt.collection.data["karate"] >>> print(gt.small_world_omega(g, niter=5, nrand=5)) -0...