aryagraph.generators.random.random_geometric#
- aryagraph.generators.random.random_geometric(n: int, radius: float, *, seed: int | Generator | None = None) Graph[source]#
Random geometric graph in the unit square.
Nodes get
pos = (x, y)uniform in[0, 1)²; two nodes are adjacent when their Euclidean distance is at most radius (<=, as in networkx). Candidate pairs come from a grid ofradius-sized cells, so the cost is O(n + m) for small radii.