I would like to generate most efficiently random geometric graphs with
G = nx.random_geometric_graph(nodes, radius)
for graphs with up to several hundred nodes. In those graphs the nodes shall furthermore ensure that they have a minimal distance (0 < min_dist < radius) between each other. Since I furthermore like to achieve the property connected on those graphs (currently I repeatedly generate graphs until there is a connected one) by repeatedly generating new graphs. I would like to solve the first problem as efficiently as possible so the repeated graph generation speeds up.
Currently I do it without networkx by generating a set of coordinates representing an rectangular field and generating the points one by one punching (set operation minus) out circular areas so that the rest of the coordinates are left for the randomiser to determine the next center.
This approach is pretty slow.
I was hoping to find something in networkx that could help me but yet I wasn't successful in doing so.
Aucun commentaire:
Enregistrer un commentaire