Say I have a networkx graph:
g=nx.gnm_random_graph(5,5)
for u,v,w in g.edges(data=True):
w = np.random.randint(0,10)
I'd like to represent this as if each edge has a fixed length (its weight value). The networks I am looking at are radial in nature - I know in advance that this is possible (I don't have the restriction raised in unutbu's comment here).
I want to randomly compute co-ordinates for the nodes (with the fixed edge length constraints) and plot them. I then want to tabulate the distance between all the nodes that are not linked by edges.
From what I've read so far, it seems as though networkx draws nodes without consideration of edge lengths. But the node positions can be explicitly defined. So I'd need to write a function to compute the node positions.
Does anyone know of a networkx, or other, function that might help with this?
More generally, is networkx suited to this task?