drewconway/NetworkX_Intro_Materials — Issue #1: Is NetworkX as scalable as you claim?
Author: conradlee
Created: 2011-11-02 10:32:17+00:00
State: open

In your slides for module II "Why Do SNA with NX", you claim that NetworkX is more scalable than most network analysis libraries.

While I am a huge fan of NetworkX, I don't think of it as particularly scalable, because at it's core it is implemented in native python---the basic representation of the adjacency matrix is a python dictionary.

Python objects (such as python ints, etc.) take up way more memory than, say, integers in C++ or integers in numpy, so that already means that I can fit only smaller graphs into memory if I'm using networkx. If networkx used a SciPy sparse matrix to represent the adjacency matrix, then this would not be the case.

Also, even simple tasks like parsing an edgelist take a lot longer using networkx because of the way memory is managed in python (e.g., the memory for the entire graph is not allocated all at once).

I was surprised to see that you describe NetworkX as being implemented in C and Fortran, when as far as I can tell it is mostly in python. I have noticed that a few algorithms such as pagerank make calls to numpy, which, depending on the system, might make use of highly efficient legacy code (in Fortran or C), but is this really generally the case?

I don't mean to criticize NetworkX---I really think it's a great library and the right tool for most networks. But as far as I can tell it's not actually the right tool for looking at huge networks, so I just don't want people to get the wrong idea from this presentation.

Maybe you can convince me that NetworkX is or will soon be good for huge graphs as well. Because I though other people would be intersted in this question, I've posted it [on Stackoverflow here](http://stackoverflow.com/questions/7978840/what-scalability-issues-are-associated-with-networkx-the-python-network-analysi)---please answer this question there.