Skip to content

Use sparse matrix#1021

Merged
hagberg merged 14 commits intonetworkx:masterfrom
hagberg:use-sparse-matrix
Dec 8, 2013
Merged

Use sparse matrix#1021
hagberg merged 14 commits intonetworkx:masterfrom
hagberg:use-sparse-matrix

Conversation

@hagberg
Copy link
Copy Markdown
Member

@hagberg hagberg commented Nov 27, 2013

Switch linalg package to use sparse matrices.

Improve efficiency in to_scipy_sparse_matrix

Addresses #969 and #913

Doesn't convert to LIL format
Resolve conflicts in eigenector.py and katz.py due to switch to sparse matrix in adj_matrix.

Conflicts:
	networkx/algorithms/centrality/eigenvector.py
	networkx/algorithms/centrality/katz.py
Mostly done conversion of directed matrix laplacian to sparse matrix format.
The "pagerank" walk is still using dense matrices.
@ghost ghost assigned hagberg Nov 27, 2013
Diags is a new scipy function?  Not found in the version on travis for testing.
@hagberg
Copy link
Copy Markdown
Member Author

hagberg commented Nov 27, 2013

OK - I finally got all of the test skipping and rough edges burnished off this one.

This converts the matrix-based algorithms to use scipy sparse matrices when possible. There are still places for improvement in style, speed, and efficiency - incidence_matrix can probably be made faster, eigenvector_centrality can use scipy.sparse.eigs (#969) etc.

Supporting the use case of not having NumPy and SciPy puts a lot of cruft into the testing code. If we want to keep those as optional packages we might consider moving the algorithms into a common place to make that easier.

hagberg added a commit that referenced this pull request Dec 8, 2013
@hagberg hagberg merged commit abc1634 into networkx:master Dec 8, 2013
@hagberg hagberg deleted the use-sparse-matrix branch December 22, 2013 17:15
@chebee7i chebee7i mentioned this pull request Apr 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants