Skip to main content
`Ctrl`+`K`

# omega

omega(G, niter=5, nrand=10, seed=None)

  Returns the small-world coefficient (omega) of a graph

  The small-world coefficient of a graph G is:

  omega = Lr/L - C/Cl

  where C and L are respectively the average clustering coefficient and average shortest path length of G. Lr is the average shortest path length of an equivalent random graph and Cl is the average clustering coefficient of an equivalent lattice graph.

  The small-world coefficient (omega) measures how much G is like a lattice or a random graph. Negative values mean G is similar to a lattice whereas positive values mean G is a random graph. Values close to 0 mean that G has small-world characteristics.

  Parameters:
    G NetworkX graph

      An undirected graph.

    niter: integer (optional, default=5)

      Approximate number of rewiring per edge to compute the equivalent random graph.

    nrand: integer (optional, default=10)

      Number of random graphs generated to compute the maximal clustering coefficient (Cr) and average shortest path length (Lr).

    seed integer, random_state, or None (default)

      Indicator of random number generation state. See Randomness.

  Returns:
    omega float

      The small-world coefficient (omega)

  Notes

  The implementation is adapted from the algorithm by Telesford et al. [1].

  References

  [1]

  Telesford, Joyce, Hayasaka, Burdette, and Laurienti (2011). “The Ubiquity of Small-World Networks”. Brain Connectivity. 1 (0038): 367-75. PMC 3604768. PMID 22432451. doi:10.1089/brain.2011.0038.