[SciPy-User] Matrix-free version of connected_components

Gael Varoquaux gael.varoquaux@normalesup....
Thu Aug 2 07:36:01 CDT 2012

On Thu, Aug 02, 2012 at 02:15:07PM +0200, Per Nielsen wrote:
>    I have looked into the functions provided by the networkX package,
>    however, as far as I have been able to understand both networkX and scipy
>    employ similar methods for finding the connected components. Thus I still
>    need the full sparse matrix (or graph which I think is similar in memory
>    usage) in memory, which I would like to avoid.

But you can easily recode them to replace the indexing by a function call
that would return the list of neighbors for a given node. That way you
don't have to store the graph, you can generate it on the fly.


More information about the SciPy-User mailing list