rustworkx.hyperbolic_random_graph#

hyperbolic_random_graph(pos, beta, r, /, seed=None)#

Return a hyperbolic random undirected graph (also called hyperbolic geometric graph).

The usual hyperbolic random graph model connects pairs of nodes with probability

P[(u,v)E]=11+exp(β(d(u,v)R)/2),

a sigmoid function that decreases as the hyperbolic distance between nodes u and v increases. The hyperbolic distance is given by

d(u,v)=arccosh[x0(u)x0(v)j=1Dxj(u)xj(v)],

where D is the dimension of the hyperbolic space and xd(u) is the d th-dimension coordinate of node u in the hyperboloid model. The number of nodes and the dimension are inferred from the coordinates pos. The 0-dimension “time” coordinate is inferred from the others.

If beta is None, all pairs of nodes with a distance smaller than r are connected.

This algorithm has a time complexity of O(n2) for n nodes.

Parameters:
  • pos (list[list[float]]) – Hyperboloid coordinates of the nodes [[x1(1), …, xD(1)], [x1(2), …, xD(2)], …]. The “time” coordinate x0 is inferred from the other coordinates.

  • beta (float) – Sigmoid sharpness (nonnegative) of the connection probability.

  • r (float) – Distance at which the connection probability is 0.5 for the probabilistic model. Threshold when beta is None.

  • seed (int) – An optional seed to use for the random number generator.

Returns:

A PyGraph object

Return type:

PyGraph