Skip to content Skip to sidebar Skip to footer

Drawing Massive Networkx Graph: Array Too Big

I'm trying to draw a networkx graph with weighted edges, but right now I'm having some difficulty. As the title suggests, this graph is really huge: Number of Nodes: 103362 Number

Solution 1:

The problem lies in the spring_layout approach. With this many nodes it will take a while to calculate where all of them should go with respect to one another. With this many nodes I would suggest either figuring out the x,y positions yourself or plot much smaller subgraphs. (<5000 nodes or your computer might be a bit sluggish for a while.

Here is what 1000 nodes from an erdos_renyi_graph (randomly chosen edges) looks like. enter image description here

It pulled off 2 nodes to highlight.

Next is what 1500 looks like enter image description here It got a little more detail. Now with 7-8 interesting nodes.

There isn't much to be gained by so many edges and so many nodes on a graph. And what happens if you don't like the output, you would need to re-run it again.

To get x,y positions of each node take a look at this. in NetworkX show graph with nodes at exact (x,y) position. Result is rotated

Post a Comment for "Drawing Massive Networkx Graph: Array Too Big"