What is the maximum number of nodes and edges with attributes that graphs generated by NetworkX package can handle?

5.1k Views Asked by At

I am writing code in Python to analyze social networks with node and edge attributes. Currently, I am using the NetworkX package to generate the graphs. Is there any limit to the size (in terms of the number of nodes, edges) of the graph which can be generated using this package?

I am new to coding social network problems in Python and have recently come across another package called NetworKit for large networks, but am not sure at what size should NetworKit be a better option, could you please elaborate on difference in performance and functionality between the two packages?

Thanks for your reply in advance.

2

There are 2 best solutions below

3
Azim Mazinani On

Is there any limit to the size (in terms of the number of nodes, edges) of the graph which can be generated using this package?

No. There is no limit. It is all dependent on your memory capacity and size.

could you please elaborate on difference in performance and functionality between the two packages?

I personally don't have any experience with NetworkKit, however here (by Timothy Lin) you can find a very good benchmarking analysis on different tools including networkx and networkkit. Check out its conclusion section:

As for recommendations on which package people should learn, I think picking up networkx is still important as it makes network science very accessible with a wide range of tools and capabilities. If analysis starts being too slow (and maybe that’s why you are here) then I will suggest taking a look at graph-tool or networkit to see if they contain the necessary algorithms for your needs.

1
Leonardo Rocco On

My suggestion:

  • Start w/ Networkx as it has a bigger community, it's well mainteined and documented... and the best of all... you can easily understand what it does as it's 100% done in Python. It's true it's not exactly fast, but it will be fast enough for most of the calculations. If you are running calculations from your laptop it can be slow for intensive calculations (Eg: sigma/omega small worldness metrics) in big networks (> 10k nodes and >100k vertexes).

  • If you need to speed it up, then you can easily incorporate networKit in your code as it integrates very easily to networkx and pandas, but it has a much more limited library of algorithms.

  • Compare yourself: NetworkX algorithms: https://networkx.github.io/documentation/stable/reference/algorithms/index.html VS NetworKit algorithms: https://networkit.github.io/dev-docs/python_api/modules.html