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
a sigmoid function that decreases as the hyperbolic distance between nodes
and increases. The hyperbolic distance is given bywhere
is the dimension of the hyperbolic space and is the th-dimension coordinate of node in the hyperboloid model. The number of nodes and the dimension are inferred from the coordinatespos
. The 0-dimension “time” coordinate is inferred from the others.If
beta
isNone
, all pairs of nodes with a distance smaller thanr
are connected.This algorithm has a time complexity of
for nodes.- Parameters:
pos (list[list[float]]) – Hyperboloid coordinates of the nodes [[
, …, ], [ , …, ], …]. The “time” coordinate 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
isNone
.seed (int) – An optional seed to use for the random number generator.
- Returns:
A PyGraph object
- Return type: