geometric_soft_configuration_graph#

geometric_soft_configuration_graph(*, beta, n=None, gamma=None, mean_degree=None, kappas=None, seed=None)[source]#

Returns a random graph from the geometric soft configuration model.

The S1 model [1] is the geometric soft configuration model which is able to explain many fundamental features of real networks such as small-world property, heteregenous degree distributions, high level of clustering, and self-similarity.

In the geometric soft configuration model, a node i is assigned two hidden variables: a hidden degree κi, quantifying its popularity, influence, or importance, and an angular position θi in a circle abstracting the similarity space, where angular distances between nodes are a proxy for their similarity. Focusing on the angular position, this model is often called the S1 model (a one-dimensional sphere). The circle’s radius is adjusted to R=N/2π, where N is the number of nodes, so that the density is set to 1 without loss of generality.

The connection probability between any pair of nodes increases with the product of their hidden degrees (i.e., their combined popularities), and decreases with the angular distance between the two nodes. Specifically, nodes i and j are connected with the probability

pij=11+dijβ(μκiκj)max(1,β)

where dij=RΔθij is the arc length of the circle between nodes i and j separated by an angular distance Δθij. Parameters μ and β (also called inverse temperature) control the average degree and the clustering coefficient, respectively.

It can be shown [2] that the model undergoes a structural phase transition at β=1 so that for β<1 networks are unclustered in the thermodynamic limit (when N) whereas for β>1 the ensemble generates networks with finite clustering coefficient.

The S1 model can be expressed as a purely geometric model H2 in the hyperbolic plane [3] by mapping the hidden degree of each node into a radial coordinate as

ri=R^2max(1,β)βζln(κiκ0)

where R^ is the radius of the hyperbolic disk and ζ is the curvature,

R^=2ζln(Nπ)2max(1,β)βζln(μκ02)

The connection probability then reads

pij=11+exp(βζ2(xijR^))

where

xij=ri+rj+2ζlnΔθij2

is a good approximation of the hyperbolic distance between two nodes separated by an angular distance Δθij with radial coordinates ri and rj. For β>1, the curvature ζ=1, for β<1, ζ=β1.

Parameters:
Either `n`, `gamma`, `mean_degree` are provided or `kappas`. The values of
`n`, `gamma`, `mean_degree` (if provided) are used to construct a random
kappa-dict keyed by node with values sampled from a power-law distribution.
betapositive number

Inverse temperature, controlling the clustering coefficient.

nint (default: None)

Size of the network (number of nodes). If not provided, kappas must be provided and holds the nodes.

gammafloat (default: None)

Exponent of the power-law distribution for hidden degrees kappas. If not provided, kappas must be provided directly.

mean_degreefloat (default: None)

The mean degree in the network. If not provided, kappas must be provided directly.

kappasdict (default: None)

A dict keyed by node to its hidden degree value. If not provided, random values are computed based on a power-law distribution using n, gamma and mean_degree.

seedint, random_state, or None (default)

Indicator of random number generation state. See Randomness.

Returns:
Graph

A random geometric soft configuration graph (undirected with no self-loops). Each node has three node-attributes:

  • kappa that represents the hidden degree.

  • theta the position in the similarity space (S1) which is also the angular position in the hyperbolic plane.

  • radius the radial position in the hyperbolic plane (based on the hidden degree).

References

[1]

Serrano, M. Á., Krioukov, D., & Boguñá, M. (2008). Self-similarity of complex networks and hidden metric spaces. Physical review letters, 100(7), 078701.

[2]

van der Kolk, J., Serrano, M. Á., & Boguñá, M. (2022). An anomalous topological phase transition in spatial random graphs. Communications Physics, 5(1), 245.

[3]

Krioukov, D., Papadopoulos, F., Kitsak, M., Vahdat, A., & Boguná, M. (2010). Hyperbolic geometry of complex networks. Physical Review E, 82(3), 036106.

Examples

Generate a network with specified parameters:

>>> G = nx.geometric_soft_configuration_graph(
...     beta=1.5, n=100, gamma=2.7, mean_degree=5
... )

Create a geometric soft configuration graph with 100 nodes. The β parameter is set to 1.5 and the exponent of the powerlaw distribution of the hidden degrees is 2.7 with mean value of 5.

Generate a network with predefined hidden degrees:

>>> kappas = {i: 10 for i in range(100)}
>>> G = nx.geometric_soft_configuration_graph(beta=2.5, kappas=kappas)

Create a geometric soft configuration graph with 100 nodes. The β parameter is set to 2.5 and all nodes with hidden degree κ=10.